Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision a454ccd7

Von Jan Büren vor etwa 1 Jahr hinzugefügt

  • ID a454ccd7c43b99b8d9e43ebe621c5cbe14f2a867
  • Vorgänger 88e0dd95
  • Nachfolger 105c3f60

Neue Datenbank-Tabelle file_versions

Unterschiede anzeigen:

SL/DB/File.pm
},
);
__PACKAGE__->meta->add_relationship(
file_version => {
type => 'one to many',
class => 'SL::DB::FileVersion',
column_map => { id => 'file_id' },
},
);
__PACKAGE__->meta->initialize;
SL/DB/FileVersion.pm
# This file has been auto-generated only because it didn't exist.
# Feel free to modify it at will; it will not be overwritten automatically.
package SL::DB::FileVersion;
use strict;
use SL::DB::MetaSetup::FileVersion;
use SL::DB::Manager::FileVersion;
__PACKAGE__->meta->initialize;
1;
SL/DB/Helper/Mappings.pm
employee_project_invoices => 'EmployeeProjectInvoices',
exchangerate => 'exchangerate',
files => 'file',
file_versions => 'file_version',
file_full_texts => 'file_full_text',
finanzamt => 'finanzamt',
follow_up_access => 'follow_up_access',
SL/DB/Manager/FileVersion.pm
# This file has been auto-generated only because it didn't exist.
# Feel free to modify it at will; it will not be overwritten automatically.
package SL::DB::Manager::FileVersion;
use strict;
use parent qw(SL::DB::Helper::Manager);
sub object_class { 'SL::DB::FileVersion' }
__PACKAGE__->make_manager_methods;
1;
SL/DB/MetaSetup/FileVersion.pm
# This file has been auto-generated. Do not modify it; it will be overwritten
# by rose_auto_create_model.pl automatically.
package SL::DB::FileVersion;
use strict;
use parent qw(SL::DB::Object);
__PACKAGE__->meta->table('file_versions');
__PACKAGE__->meta->columns(
backend => { type => 'text', not_null => 1 },
doc_path => { type => 'text', not_null => 1 },
file_id => { type => 'integer', not_null => 1 },
file_location => { type => 'text', not_null => 1 },
guid => { type => 'text' },
itime => { type => 'timestamp', default => 'now()', not_null => 1 },
mtime => { type => 'timestamp' },
version => { type => 'integer', not_null => 1 },
);
__PACKAGE__->meta->primary_key_columns([ 'file_id', 'version' ]);
__PACKAGE__->meta->allow_inline_column_values(1);
__PACKAGE__->meta->foreign_keys(
file => {
class => 'SL::DB::File',
key_columns => { file_id => 'id' },
},
);
1;
;
sql/Pg-upgrade2/file_version.sql
-- @tag: file_version
-- @description: Tabelle für Dokumentenversion
-- @depends: release_3_6_0
CREATE TABLE IF NOT EXISTS file_versions (
guid TEXT,
file_id INTEGER NOT NULL REFERENCES files(id) ON DELETE CASCADE,
version INTEGER NOT NULL,
file_location TEXT NOT NULL,
doc_path TEXT NOT NULL,
backend TEXT NOT NULL,
itime TIMESTAMP NOT NULL DEFAULT now(),
mtime TIMESTAMP,
PRIMARY KEY (file_id, version)
);
CREATE TRIGGER mtime_file_version BEFORE UPDATE ON file_versions FOR EACH ROW EXECUTE PROCEDURE set_mtime();

Auch abrufbar als: Unified diff