Revision aa088ea8
Von Bernd Bleßmann vor 11 Monaten hinzugefügt
SL/DB/MetaSetup/FileVersion.pm | ||
---|---|---|
13 | 13 |
doc_path => { type => 'text', not_null => 1 }, |
14 | 14 |
file_id => { type => 'integer', not_null => 1 }, |
15 | 15 |
file_location => { type => 'text', not_null => 1 }, |
16 |
guid => { type => 'text' }, |
|
16 |
guid => { type => 'text', not_null => 1 },
|
|
17 | 17 |
itime => { type => 'timestamp', default => 'now()', not_null => 1 }, |
18 | 18 |
mtime => { type => 'timestamp' }, |
19 | 19 |
version => { type => 'integer', not_null => 1 }, |
20 | 20 |
); |
21 | 21 |
|
22 |
__PACKAGE__->meta->primary_key_columns([ 'file_id', 'version' ]);
|
|
22 |
__PACKAGE__->meta->primary_key_columns([ 'guid' ]);
|
|
23 | 23 |
|
24 | 24 |
__PACKAGE__->meta->allow_inline_column_values(1); |
25 | 25 |
|
sql/Pg-upgrade2/file_versions_guid_as_primary_key.sql | ||
---|---|---|
1 |
-- @tag: file_versions_guid_as_primary_key |
|
2 |
-- @description: guid-Spalte als Primärschlüssel |
|
3 |
-- @depends: release_3_6_0 file_version |
|
4 |
|
|
5 |
ALTER TABLE file_versions |
|
6 |
DROP CONSTRAINT file_versions_pkey, |
|
7 |
ADD UNIQUE (guid), |
|
8 |
ADD PRIMARY KEY (guid); |
Auch abrufbar als: Unified diff
file_versions: Spalte guid als Primärschlüssel