Revision ab56c1a0
Von Moritz Bunkus vor mehr als 11 Jahren hinzugefügt
SL/DB/MetaSetup/CustomVariableConfig.pm | ||
---|---|---|
11 | 11 |
|
12 | 12 |
columns => [ |
13 | 13 |
id => { type => 'integer', not_null => 1, sequence => 'custom_variable_configs_id' }, |
14 |
name => { type => 'text' }, |
|
15 |
description => { type => 'text' }, |
|
16 |
type => { type => 'varchar', length => 20 },
|
|
17 |
module => { type => 'varchar', length => 20 },
|
|
14 |
name => { type => 'text', not_null => 1 },
|
|
15 |
description => { type => 'text', not_null => 1 },
|
|
16 |
type => { type => 'text', not_null => 1 },
|
|
17 |
module => { type => 'text', not_null => 1 },
|
|
18 | 18 |
default_value => { type => 'text' }, |
19 | 19 |
options => { type => 'text' }, |
20 |
searchable => { type => 'boolean' }, |
|
21 |
includeable => { type => 'boolean' }, |
|
22 |
included_by_default => { type => 'boolean' }, |
|
23 |
sortkey => { type => 'integer' }, |
|
20 |
searchable => { type => 'boolean', not_null => 1 },
|
|
21 |
includeable => { type => 'boolean', not_null => 1 },
|
|
22 |
included_by_default => { type => 'boolean', not_null => 1 },
|
|
23 |
sortkey => { type => 'integer', not_null => 1 },
|
|
24 | 24 |
itime => { type => 'timestamp', default => 'now()' }, |
25 | 25 |
mtime => { type => 'timestamp' }, |
26 | 26 |
flags => { type => 'text' }, |
sql/Pg-upgrade2/custom_variable_configs_column_type_text.sql | ||
---|---|---|
1 |
-- @tag: custom_variable_configs_column_type_text |
|
2 |
-- @description: Spaltentypen in 'custom_varialbe_configs' anpassen & schärfere Restriktionen |
|
3 |
-- @depends: release_3_0_0 |
|
4 |
-- @charset: utf-8 |
|
5 |
ALTER TABLE custom_variable_configs ALTER COLUMN type TYPE TEXT; |
|
6 |
ALTER TABLE custom_variable_configs ALTER COLUMN module TYPE TEXT; |
|
7 |
|
|
8 |
UPDATE custom_variable_configs SET searchable = FALSE WHERE searchable IS NULL; |
|
9 |
UPDATE custom_variable_configs SET includeable = FALSE WHERE includeable IS NULL; |
|
10 |
UPDATE custom_variable_configs SET included_by_default = FALSE WHERE included_by_default IS NULL; |
|
11 |
|
|
12 |
ALTER TABLE custom_variable_configs ALTER COLUMN searchable SET NOT NULL; |
|
13 |
ALTER TABLE custom_variable_configs ALTER COLUMN includeable SET NOT NULL; |
|
14 |
ALTER TABLE custom_variable_configs ALTER COLUMN included_by_default SET NOT NULL; |
|
15 |
ALTER TABLE custom_variable_configs ALTER COLUMN name SET NOT NULL; |
|
16 |
ALTER TABLE custom_variable_configs ALTER COLUMN description SET NOT NULL; |
|
17 |
ALTER TABLE custom_variable_configs ALTER COLUMN type SET NOT NULL; |
|
18 |
ALTER TABLE custom_variable_configs ALTER COLUMN module SET NOT NULL; |
|
19 |
ALTER TABLE custom_variable_configs ALTER COLUMN sortkey SET NOT NULL; |
|
20 |
|
|
21 |
ALTER TABLE custom_variable_configs |
|
22 |
ADD CONSTRAINT custom_variable_configs_name_description_type_module_not_empty |
|
23 |
CHECK ( type <> '' |
|
24 |
AND module <> '' |
|
25 |
AND name <> '' |
|
26 |
AND description <> ''); |
|
27 |
|
|
28 |
ALTER TABLE custom_variable_configs |
|
29 |
ADD CONSTRAINT custom_variable_configs_options_not_empty_for_select |
|
30 |
CHECK ((type <> 'select') OR (COALESCE(options, '') <> '')); |
Auch abrufbar als: Unified diff
Spaltentyp "custom_variable_configs.type" und ".module" auf TEXT geändert