@opengis/fastify-table 1.1.65 → 1.1.66
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/package.json
CHANGED
|
@@ -30,11 +30,13 @@ CREATE TABLE IF NOT EXISTS log.user_auth();
|
|
|
30
30
|
ALTER TABLE log.user_auth ADD COLUMN IF NOT EXISTS user_auth_id text NOT NULL DEFAULT next_id();
|
|
31
31
|
ALTER TABLE log.user_auth ADD COLUMN IF NOT EXISTS user_id text;
|
|
32
32
|
ALTER TABLE log.user_auth ADD COLUMN IF NOT EXISTS auth_date timestamp without time zone;
|
|
33
|
+
ALTER TABLE log.user_auth ALTER COLUMN auth_date SET DEFAULT (now())::timestamp without time zone;
|
|
33
34
|
ALTER TABLE log.user_auth ADD COLUMN IF NOT EXISTS auth_type text;
|
|
34
35
|
ALTER TABLE log.user_auth ADD COLUMN IF NOT EXISTS uid text;
|
|
35
36
|
ALTER TABLE log.user_auth ADD COLUMN IF NOT EXISTS cdate timestamp without time zone DEFAULT (now())::timestamp without time zone;
|
|
36
37
|
ALTER TABLE log.user_auth ADD COLUMN IF NOT EXISTS editor_id text;
|
|
37
38
|
ALTER TABLE log.user_auth ADD COLUMN IF NOT EXISTS editor_date timestamp without time zone;
|
|
39
|
+
ALTER TABLE log.user_auth ADD COLUMN IF NOT EXISTS auth_data json;
|
|
38
40
|
|
|
39
41
|
COMMENT ON TABLE log.table_changes IS 'Логи подій змін в БД';
|
|
40
42
|
COMMENT ON COLUMN log.table_changes.change_type IS 'Тип події (insert / update / delete)';
|
|
@@ -53,6 +55,7 @@ COMMENT ON TABLE log.user_auth IS 'Логи авторизації';
|
|
|
53
55
|
COMMENT ON COLUMN log.user_auth.user_id IS 'ID користувача';
|
|
54
56
|
COMMENT ON COLUMN log.user_auth.auth_date IS 'Дата авторизації';
|
|
55
57
|
COMMENT ON COLUMN log.user_auth.auth_type IS 'Тип авторизації';
|
|
58
|
+
COMMENT ON COLUMN log.user_auth.auth_data IS 'Дані про користувача';
|
|
56
59
|
|
|
57
60
|
ALTER TABLE log.table_changes DROP CONSTRAINT IF EXISTS log_table_changes_pkey cascade;
|
|
58
61
|
ALTER TABLE log.table_changes_data DROP CONSTRAINT IF EXISTS log_table_changes_data_pkey;
|
|
@@ -5,6 +5,7 @@ CREATE TABLE if not exists admin.users();
|
|
|
5
5
|
ALTER TABLE admin.users add column if not exists uid text NOT NULL DEFAULT next_id();
|
|
6
6
|
ALTER TABLE admin.users DROP CONSTRAINT if exists admin_user_uid_pkey cascade;
|
|
7
7
|
ALTER TABLE admin.users DROP CONSTRAINT if exists user_pk cascade;
|
|
8
|
+
ALTER TABLE admin.users DROP CONSTRAINT if exists admin_user_user_rnokpp cascade;
|
|
8
9
|
|
|
9
10
|
ALTER TABLE admin.users add column if not exists login text;
|
|
10
11
|
ALTER TABLE admin.users add column if not exists password text NOT NULL DEFAULT ''::text;
|
|
@@ -25,6 +26,7 @@ ALTER TABLE admin.users add column if not exists editor_id text;
|
|
|
25
26
|
ALTER TABLE admin.users add column if not exists editor_date timestamp without time zone;
|
|
26
27
|
|
|
27
28
|
ALTER TABLE admin.users add CONSTRAINT admin_user_uid_pkey PRIMARY KEY (uid);
|
|
29
|
+
ALTER TABLE admin.users add CONSTRAINT admin_user_user_rnokpp UNIQUE (user_rnokpp);
|
|
28
30
|
|
|
29
31
|
COMMENT ON TABLE admin.users IS 'Користувачі';
|
|
30
32
|
|
|
@@ -4,8 +4,8 @@ const data = {};
|
|
|
4
4
|
|
|
5
5
|
// decorator
|
|
6
6
|
export default async function getMeta(opt) {
|
|
7
|
-
const pg = opt
|
|
8
|
-
const table = opt
|
|
7
|
+
const pg = opt?.pg || getPG({ name: 'client' });
|
|
8
|
+
const table = opt?.table || opt;
|
|
9
9
|
|
|
10
10
|
if (data[table]) return data[table];
|
|
11
11
|
|