@opengis/fastify-table 1.1.9 → 1.1.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.eslintrc.cjs +42 -42
- package/Changelog.md +305 -305
- package/crud/controllers/deleteCrud.js +22 -22
- package/crud/controllers/insert.js +61 -61
- package/crud/controllers/update.js +62 -62
- package/crud/funcs/dataDelete.js +19 -19
- package/crud/funcs/dataInsert.js +30 -30
- package/crud/funcs/dataUpdate.js +48 -36
- package/crud/funcs/getAccess.js +53 -53
- package/crud/funcs/getOpt.js +10 -10
- package/crud/funcs/setOpt.js +16 -16
- package/crud/funcs/utils/logChanges.js +76 -76
- package/crud/index.js +36 -36
- package/helper.js +28 -28
- package/index.js +97 -97
- package/migration/exec.migrations.js +79 -79
- package/notification/controllers/userNotifications.js +19 -19
- package/notification/funcs/addNotification.js +8 -8
- package/notification/funcs/sendNotification.js +111 -111
- package/package.json +26 -26
- package/pg/funcs/getMeta.js +27 -27
- package/pg/pgClients.js +20 -20
- package/policy/funcs/checkPolicy.js +83 -83
- package/policy/funcs/sqlInjection.js +33 -33
- package/policy/index.js +14 -14
- package/redis/client.js +8 -8
- package/redis/funcs/redisClients.js +2 -2
- package/redis/index.js +19 -19
- package/server/migrations/0.sql +78 -78
- package/server/migrations/properties.sql +30 -30
- package/server/migrations/roles.sql +164 -164
- package/server/migrations/users.sql +89 -89
- package/table/controllers/data.js +103 -103
- package/table/controllers/filter.js +40 -37
- package/table/controllers/search.js +80 -80
- package/table/controllers/suggest.js +79 -79
- package/table/controllers/table.js +52 -52
- package/table/controllers/utils/addTemplateDir.js +8 -8
- package/table/controllers/utils/getSelect.js +19 -19
- package/table/controllers/utils/getSelectMeta.js +66 -66
- package/table/controllers/utils/getTemplate_old.js +28 -28
- package/table/controllers/utils/getTemplates.js +18 -18
- package/table/controllers/utils/gisIRColumn.js +68 -68
- package/table/controllers/utils/loadTemplate.js +1 -1
- package/table/controllers/utils/loadTemplatePath.js +1 -1
- package/table/controllers/utils/userTemplateDir.js +1 -1
- package/table/funcs/getFilterSQL/index.js +79 -79
- package/table/funcs/getFilterSQL/util/formatValue.js +142 -142
- package/table/funcs/getFilterSQL/util/getCustomQuery.js +13 -13
- package/table/funcs/getFilterSQL/util/getFilterQuery.js +73 -73
- package/table/funcs/getFilterSQL/util/getOptimizedQuery.js +12 -12
- package/table/funcs/getFilterSQL/util/getTableSql.js +34 -34
- package/table/funcs/metaFormat/getSelectVal.js +20 -20
- package/table/funcs/metaFormat/index.js +28 -28
- package/table/index.js +84 -84
- package/test/api/crud.test.js +89 -89
- package/test/api/suggest.test.js +66 -66
- package/test/api/table.test.js +89 -89
- package/test/api/widget.test.js +117 -117
- package/test/templates/select/test.storage.data.json +3 -3
- package/test/templates/select/test.suggest.ato_new.json +3 -3
- package/test/templates/select/test.suggest.ato_new.sql +25 -25
- package/test/templates/select/test.suggest.data.json +4 -4
- package/test/templates/select/test.suggest.parent.sql +1 -1
- package/util/controllers/properties.add.js +57 -57
- package/util/controllers/status.monitor.js +8 -8
- package/utils.js +48 -48
- package/widget/controllers/utils/historyFormat.js +76 -76
- package/widget/controllers/utils/obj2db.js +13 -13
- package/widget/controllers/widget.del.js +44 -44
- package/widget/controllers/widget.get.js +98 -98
- package/widget/controllers/widget.set.js +76 -76
- package/widget/index.js +40 -40
|
@@ -1,33 +1,33 @@
|
|
|
1
|
-
const sqlInjection = [
|
|
2
|
-
'()',
|
|
3
|
-
'^',
|
|
4
|
-
'*',
|
|
5
|
-
'like ',
|
|
6
|
-
'@variable',
|
|
7
|
-
'@@variable',
|
|
8
|
-
'group by ',
|
|
9
|
-
'union ',
|
|
10
|
-
'select ',
|
|
11
|
-
'having ',
|
|
12
|
-
'as injectx',
|
|
13
|
-
'where ',
|
|
14
|
-
'rlike ',
|
|
15
|
-
'if(',
|
|
16
|
-
'sleep(',
|
|
17
|
-
'waitfor delay',
|
|
18
|
-
'benchmark(',
|
|
19
|
-
'pg_sleep(',
|
|
20
|
-
"'\\\"",
|
|
21
|
-
'randomblob(',
|
|
22
|
-
'order by ',
|
|
23
|
-
'union all ',
|
|
24
|
-
'+or',
|
|
25
|
-
'or ',
|
|
26
|
-
'and ',
|
|
27
|
-
"'' ",
|
|
28
|
-
'""" ',
|
|
29
|
-
'<script',
|
|
30
|
-
'javascript:',
|
|
31
|
-
]
|
|
32
|
-
|
|
33
|
-
export default sqlInjection;
|
|
1
|
+
const sqlInjection = [
|
|
2
|
+
'()',
|
|
3
|
+
'^',
|
|
4
|
+
'*',
|
|
5
|
+
'like ',
|
|
6
|
+
'@variable',
|
|
7
|
+
'@@variable',
|
|
8
|
+
'group by ',
|
|
9
|
+
'union ',
|
|
10
|
+
'select ',
|
|
11
|
+
'having ',
|
|
12
|
+
'as injectx',
|
|
13
|
+
'where ',
|
|
14
|
+
'rlike ',
|
|
15
|
+
'if(',
|
|
16
|
+
'sleep(',
|
|
17
|
+
'waitfor delay',
|
|
18
|
+
'benchmark(',
|
|
19
|
+
'pg_sleep(',
|
|
20
|
+
"'\\\"",
|
|
21
|
+
'randomblob(',
|
|
22
|
+
'order by ',
|
|
23
|
+
'union all ',
|
|
24
|
+
'+or',
|
|
25
|
+
'or ',
|
|
26
|
+
'and ',
|
|
27
|
+
"'' ",
|
|
28
|
+
'""" ',
|
|
29
|
+
'<script',
|
|
30
|
+
'javascript:',
|
|
31
|
+
]
|
|
32
|
+
|
|
33
|
+
export default sqlInjection;
|
package/policy/index.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
// import fp from 'fastify-plugin';
|
|
2
|
-
|
|
3
|
-
import checkPolicy from './funcs/checkPolicy.js';
|
|
4
|
-
|
|
5
|
-
async function plugin(fastify) {
|
|
6
|
-
fastify.addHook('onRequest', async (request, reply) => {
|
|
7
|
-
const hookData = checkPolicy(request);
|
|
8
|
-
if (hookData?.status && hookData?.message) {
|
|
9
|
-
return reply.status(hookData?.status).send(hookData.message);
|
|
10
|
-
}
|
|
11
|
-
});
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
export default plugin;
|
|
1
|
+
// import fp from 'fastify-plugin';
|
|
2
|
+
|
|
3
|
+
import checkPolicy from './funcs/checkPolicy.js';
|
|
4
|
+
|
|
5
|
+
async function plugin(fastify) {
|
|
6
|
+
fastify.addHook('onRequest', async (request, reply) => {
|
|
7
|
+
const hookData = checkPolicy(request);
|
|
8
|
+
if (hookData?.status && hookData?.message) {
|
|
9
|
+
return reply.status(hookData?.status).send(hookData.message);
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export default plugin;
|
package/redis/client.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import redisClients from './funcs/redisClients.js';
|
|
2
|
-
import getRedis from './funcs/getRedis.js';
|
|
3
|
-
|
|
4
|
-
if (!redisClients[0]) {
|
|
5
|
-
getRedis({ db: 0 });
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
export default redisClients[0];
|
|
1
|
+
import redisClients from './funcs/redisClients.js';
|
|
2
|
+
import getRedis from './funcs/getRedis.js';
|
|
3
|
+
|
|
4
|
+
if (!redisClients[0]) {
|
|
5
|
+
getRedis({ db: 0 });
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export default redisClients[0];
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const redisClients = {};
|
|
2
|
-
export default redisClients;
|
|
1
|
+
const redisClients = {};
|
|
2
|
+
export default redisClients;
|
package/redis/index.js
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
// import client from './client.js';
|
|
2
|
-
import getRedis from './funcs/getRedis.js';
|
|
3
|
-
// import client from './funcs/redisClients.js';
|
|
4
|
-
|
|
5
|
-
function close(fastify) {
|
|
6
|
-
fastify.rclient.quit();
|
|
7
|
-
// fastify.rclient2.quit();
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
async function plugin(fastify) {
|
|
11
|
-
const client = getRedis({ db: 0, funcs: fastify });
|
|
12
|
-
client.getJSON = client.get;
|
|
13
|
-
fastify.decorate('rclient', client);
|
|
14
|
-
fastify.decorate('getRedis', getRedis);
|
|
15
|
-
// fastify.decorate('rclient2', client2);
|
|
16
|
-
fastify.addHook('onClose', close);
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
export default plugin;
|
|
1
|
+
// import client from './client.js';
|
|
2
|
+
import getRedis from './funcs/getRedis.js';
|
|
3
|
+
// import client from './funcs/redisClients.js';
|
|
4
|
+
|
|
5
|
+
function close(fastify) {
|
|
6
|
+
fastify.rclient.quit();
|
|
7
|
+
// fastify.rclient2.quit();
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
async function plugin(fastify) {
|
|
11
|
+
const client = getRedis({ db: 0, funcs: fastify });
|
|
12
|
+
client.getJSON = client.get;
|
|
13
|
+
fastify.decorate('rclient', client);
|
|
14
|
+
fastify.decorate('getRedis', getRedis);
|
|
15
|
+
// fastify.decorate('rclient2', client2);
|
|
16
|
+
fastify.addHook('onClose', close);
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export default plugin;
|
package/server/migrations/0.sql
CHANGED
|
@@ -1,78 +1,78 @@
|
|
|
1
|
-
-- fix error if function exists and return type not text i.e bigint
|
|
2
|
-
|
|
3
|
-
do $$
|
|
4
|
-
|
|
5
|
-
declare
|
|
6
|
-
m record;
|
|
7
|
-
_pk text;
|
|
8
|
-
_tables json;
|
|
9
|
-
_returnType text;
|
|
10
|
-
|
|
11
|
-
begin
|
|
12
|
-
|
|
13
|
-
select format_type(p.prorettype, null) as return_type
|
|
14
|
-
from pg_proc p
|
|
15
|
-
where p.proname = 'next_id'
|
|
16
|
-
and p.pronamespace = 'public'::regnamespace into _returnType;
|
|
17
|
-
|
|
18
|
-
if (_returnType != 'text') then
|
|
19
|
-
raise notice 'default reassign start: % -> text', _returnType;
|
|
20
|
-
|
|
21
|
-
CREATE EXTENSION if not exists "uuid-ossp";
|
|
22
|
-
|
|
23
|
-
SELECT json_object_agg(a.attrelid::regclass, a.attname)
|
|
24
|
-
FROM pg_catalog.pg_attribute a
|
|
25
|
-
LEFT JOIN pg_catalog.pg_attrdef d ON (a.attrelid, a.attnum) = (d.adrelid, d.adnum)
|
|
26
|
-
WHERE NOT a.attisdropped -- no dropped (dead) columns
|
|
27
|
-
AND a.attnum > 0 -- no system columns
|
|
28
|
-
AND pg_get_expr(d.adbin, d.adrelid) = 'next_id()' into _tables;
|
|
29
|
-
|
|
30
|
-
FOR m in (select json_object_keys(_tables) as table) loop
|
|
31
|
-
_pk = _tables->>m.table;
|
|
32
|
-
raise notice 'drop default: %,%', m.table, _pk;
|
|
33
|
-
EXECUTE('alter table '|| m.table || ' alter column ' || _pk || ' set default null;');
|
|
34
|
-
end loop;
|
|
35
|
-
|
|
36
|
-
DROP FUNCTION IF EXISTS next_id();
|
|
37
|
-
|
|
38
|
-
CREATE EXTENSION if not exists "uuid-ossp";
|
|
39
|
-
|
|
40
|
-
CREATE OR REPLACE FUNCTION next_id()
|
|
41
|
-
RETURNS text AS
|
|
42
|
-
$BODY$
|
|
43
|
-
DECLARE
|
|
44
|
-
|
|
45
|
-
BEGIN
|
|
46
|
-
return replace(uuid_generate_v4()::text, '-', '');
|
|
47
|
-
END;
|
|
48
|
-
$BODY$
|
|
49
|
-
LANGUAGE plpgsql VOLATILE
|
|
50
|
-
COST 100;
|
|
51
|
-
|
|
52
|
-
FOR m in (select json_object_keys(_tables) as table) loop
|
|
53
|
-
_pk = _tables->>m.table;
|
|
54
|
-
raise notice 'reassign default: %, %', m.table, _pk;
|
|
55
|
-
EXECUTE('alter table '|| m.table || ' alter column ' || _pk || ' set default next_id();');
|
|
56
|
-
end loop;
|
|
57
|
-
|
|
58
|
-
raise notice 'reassign default finish: %', _tables;
|
|
59
|
-
|
|
60
|
-
else
|
|
61
|
-
raise notice 'skip default reassign';
|
|
62
|
-
|
|
63
|
-
CREATE EXTENSION if not exists "uuid-ossp";
|
|
64
|
-
|
|
65
|
-
CREATE OR REPLACE FUNCTION next_id()
|
|
66
|
-
RETURNS text AS
|
|
67
|
-
$BODY$
|
|
68
|
-
DECLARE
|
|
69
|
-
|
|
70
|
-
BEGIN
|
|
71
|
-
return replace(uuid_generate_v4()::text, '-', '');
|
|
72
|
-
END;
|
|
73
|
-
$BODY$
|
|
74
|
-
LANGUAGE plpgsql VOLATILE
|
|
75
|
-
COST 100;
|
|
76
|
-
end if;
|
|
77
|
-
|
|
78
|
-
end $$
|
|
1
|
+
-- fix error if function exists and return type not text i.e bigint
|
|
2
|
+
|
|
3
|
+
do $$
|
|
4
|
+
|
|
5
|
+
declare
|
|
6
|
+
m record;
|
|
7
|
+
_pk text;
|
|
8
|
+
_tables json;
|
|
9
|
+
_returnType text;
|
|
10
|
+
|
|
11
|
+
begin
|
|
12
|
+
|
|
13
|
+
select format_type(p.prorettype, null) as return_type
|
|
14
|
+
from pg_proc p
|
|
15
|
+
where p.proname = 'next_id'
|
|
16
|
+
and p.pronamespace = 'public'::regnamespace into _returnType;
|
|
17
|
+
|
|
18
|
+
if (_returnType != 'text') then
|
|
19
|
+
raise notice 'default reassign start: % -> text', _returnType;
|
|
20
|
+
|
|
21
|
+
CREATE EXTENSION if not exists "uuid-ossp";
|
|
22
|
+
|
|
23
|
+
SELECT json_object_agg(a.attrelid::regclass, a.attname)
|
|
24
|
+
FROM pg_catalog.pg_attribute a
|
|
25
|
+
LEFT JOIN pg_catalog.pg_attrdef d ON (a.attrelid, a.attnum) = (d.adrelid, d.adnum)
|
|
26
|
+
WHERE NOT a.attisdropped -- no dropped (dead) columns
|
|
27
|
+
AND a.attnum > 0 -- no system columns
|
|
28
|
+
AND pg_get_expr(d.adbin, d.adrelid) = 'next_id()' into _tables;
|
|
29
|
+
|
|
30
|
+
FOR m in (select json_object_keys(_tables) as table) loop
|
|
31
|
+
_pk = _tables->>m.table;
|
|
32
|
+
raise notice 'drop default: %,%', m.table, _pk;
|
|
33
|
+
EXECUTE('alter table '|| m.table || ' alter column ' || _pk || ' set default null;');
|
|
34
|
+
end loop;
|
|
35
|
+
|
|
36
|
+
DROP FUNCTION IF EXISTS next_id();
|
|
37
|
+
|
|
38
|
+
CREATE EXTENSION if not exists "uuid-ossp";
|
|
39
|
+
|
|
40
|
+
CREATE OR REPLACE FUNCTION next_id()
|
|
41
|
+
RETURNS text AS
|
|
42
|
+
$BODY$
|
|
43
|
+
DECLARE
|
|
44
|
+
|
|
45
|
+
BEGIN
|
|
46
|
+
return replace(uuid_generate_v4()::text, '-', '');
|
|
47
|
+
END;
|
|
48
|
+
$BODY$
|
|
49
|
+
LANGUAGE plpgsql VOLATILE
|
|
50
|
+
COST 100;
|
|
51
|
+
|
|
52
|
+
FOR m in (select json_object_keys(_tables) as table) loop
|
|
53
|
+
_pk = _tables->>m.table;
|
|
54
|
+
raise notice 'reassign default: %, %', m.table, _pk;
|
|
55
|
+
EXECUTE('alter table '|| m.table || ' alter column ' || _pk || ' set default next_id();');
|
|
56
|
+
end loop;
|
|
57
|
+
|
|
58
|
+
raise notice 'reassign default finish: %', _tables;
|
|
59
|
+
|
|
60
|
+
else
|
|
61
|
+
raise notice 'skip default reassign';
|
|
62
|
+
|
|
63
|
+
CREATE EXTENSION if not exists "uuid-ossp";
|
|
64
|
+
|
|
65
|
+
CREATE OR REPLACE FUNCTION next_id()
|
|
66
|
+
RETURNS text AS
|
|
67
|
+
$BODY$
|
|
68
|
+
DECLARE
|
|
69
|
+
|
|
70
|
+
BEGIN
|
|
71
|
+
return replace(uuid_generate_v4()::text, '-', '');
|
|
72
|
+
END;
|
|
73
|
+
$BODY$
|
|
74
|
+
LANGUAGE plpgsql VOLATILE
|
|
75
|
+
COST 100;
|
|
76
|
+
end if;
|
|
77
|
+
|
|
78
|
+
end $$
|
|
@@ -1,31 +1,31 @@
|
|
|
1
|
-
create schema if not exists admin;
|
|
2
|
-
|
|
3
|
-
-- DROP TABLE admin.properties;
|
|
4
|
-
CREATE TABLE IF NOT EXISTS admin.properties();
|
|
5
|
-
ALTER TABLE admin.properties DROP CONSTRAINT IF EXISTS admin_properties_property_id_pkey;
|
|
6
|
-
ALTER TABLE admin.properties ADD COLUMN IF NOT EXISTS property_id text NOT NULL DEFAULT next_id();
|
|
7
|
-
|
|
8
|
-
ALTER TABLE admin.properties ADD COLUMN IF NOT EXISTS property_entity text;
|
|
9
|
-
COMMENT ON COLUMN admin.properties.property_entity IS 'Сутність';
|
|
10
|
-
ALTER TABLE admin.properties ADD COLUMN IF NOT EXISTS property_key text;
|
|
11
|
-
COMMENT ON COLUMN admin.properties.property_key IS 'Ключ';
|
|
12
|
-
ALTER TABLE admin.properties ADD COLUMN IF NOT EXISTS property_text text;
|
|
13
|
-
COMMENT ON COLUMN admin.properties.property_text IS 'Текстове значення налаштування';
|
|
14
|
-
ALTER TABLE admin.properties ADD COLUMN IF NOT EXISTS property_int integer;
|
|
15
|
-
COMMENT ON COLUMN admin.properties.property_int IS 'Цілочислове значения';
|
|
16
|
-
ALTER TABLE admin.properties ADD COLUMN IF NOT EXISTS property_json json;
|
|
17
|
-
COMMENT ON COLUMN admin.properties.property_json IS 'Значення налаштування';
|
|
18
|
-
ALTER TABLE admin.properties ADD COLUMN IF NOT EXISTS level text;
|
|
19
|
-
COMMENT ON COLUMN admin.properties.level IS 'Рівень (user/system)';
|
|
20
|
-
ALTER TABLE admin.properties ADD COLUMN IF NOT EXISTS object_id text;
|
|
21
|
-
COMMENT ON COLUMN admin.properties.object_id IS 'ID Об''єкту';
|
|
22
|
-
|
|
23
|
-
ALTER TABLE admin.properties ADD COLUMN IF NOT EXISTS uid text NOT NULL DEFAULT '1'::text;
|
|
24
|
-
ALTER TABLE admin.properties ADD COLUMN IF NOT EXISTS editor_id text;
|
|
25
|
-
ALTER TABLE admin.properties ADD COLUMN IF NOT EXISTS editor_date timestamp without time zone;
|
|
26
|
-
ALTER TABLE admin.properties ADD COLUMN IF NOT EXISTS cdate timestamp without time zone DEFAULT now();
|
|
27
|
-
ALTER TABLE admin.properties ADD COLUMN IF NOT EXISTS files json;
|
|
28
|
-
|
|
29
|
-
ALTER TABLE admin.properties ADD CONSTRAINT admin_properties_property_id_pkey PRIMARY KEY(property_id);
|
|
30
|
-
|
|
1
|
+
create schema if not exists admin;
|
|
2
|
+
|
|
3
|
+
-- DROP TABLE admin.properties;
|
|
4
|
+
CREATE TABLE IF NOT EXISTS admin.properties();
|
|
5
|
+
ALTER TABLE admin.properties DROP CONSTRAINT IF EXISTS admin_properties_property_id_pkey;
|
|
6
|
+
ALTER TABLE admin.properties ADD COLUMN IF NOT EXISTS property_id text NOT NULL DEFAULT next_id();
|
|
7
|
+
|
|
8
|
+
ALTER TABLE admin.properties ADD COLUMN IF NOT EXISTS property_entity text;
|
|
9
|
+
COMMENT ON COLUMN admin.properties.property_entity IS 'Сутність';
|
|
10
|
+
ALTER TABLE admin.properties ADD COLUMN IF NOT EXISTS property_key text;
|
|
11
|
+
COMMENT ON COLUMN admin.properties.property_key IS 'Ключ';
|
|
12
|
+
ALTER TABLE admin.properties ADD COLUMN IF NOT EXISTS property_text text;
|
|
13
|
+
COMMENT ON COLUMN admin.properties.property_text IS 'Текстове значення налаштування';
|
|
14
|
+
ALTER TABLE admin.properties ADD COLUMN IF NOT EXISTS property_int integer;
|
|
15
|
+
COMMENT ON COLUMN admin.properties.property_int IS 'Цілочислове значения';
|
|
16
|
+
ALTER TABLE admin.properties ADD COLUMN IF NOT EXISTS property_json json;
|
|
17
|
+
COMMENT ON COLUMN admin.properties.property_json IS 'Значення налаштування';
|
|
18
|
+
ALTER TABLE admin.properties ADD COLUMN IF NOT EXISTS level text;
|
|
19
|
+
COMMENT ON COLUMN admin.properties.level IS 'Рівень (user/system)';
|
|
20
|
+
ALTER TABLE admin.properties ADD COLUMN IF NOT EXISTS object_id text;
|
|
21
|
+
COMMENT ON COLUMN admin.properties.object_id IS 'ID Об''єкту';
|
|
22
|
+
|
|
23
|
+
ALTER TABLE admin.properties ADD COLUMN IF NOT EXISTS uid text NOT NULL DEFAULT '1'::text;
|
|
24
|
+
ALTER TABLE admin.properties ADD COLUMN IF NOT EXISTS editor_id text;
|
|
25
|
+
ALTER TABLE admin.properties ADD COLUMN IF NOT EXISTS editor_date timestamp without time zone;
|
|
26
|
+
ALTER TABLE admin.properties ADD COLUMN IF NOT EXISTS cdate timestamp without time zone DEFAULT now();
|
|
27
|
+
ALTER TABLE admin.properties ADD COLUMN IF NOT EXISTS files json;
|
|
28
|
+
|
|
29
|
+
ALTER TABLE admin.properties ADD CONSTRAINT admin_properties_property_id_pkey PRIMARY KEY(property_id);
|
|
30
|
+
|
|
31
31
|
COMMENT ON TABLE admin.properties IS 'Налаштування';
|