Browse Source

Merge f482040de5 into 66cf179bca

pull/5696/merge
Haras 4 days ago
committed by GitHub
parent
commit
d0cfca015d
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 18
      migrations/postgresql/2019-09-12-100000_create_tables/up.sql
  2. 2
      migrations/postgresql/2019-10-10-083032_add_column_to_twofactor/up.sql
  3. 2
      migrations/postgresql/2019-11-17-011009_add_email_verification/up.sql
  4. 2
      migrations/postgresql/2020-03-13-205045_add_policy_table/up.sql
  5. 12
      migrations/postgresql/2020-08-02-025025_add_favorites_table/down.sql
  6. 10
      migrations/postgresql/2020-08-02-025025_add_favorites_table/up.sql
  7. 11
      migrations/postgresql/2020-08-02-025026_add_favorites_table_fix/down.sql
  8. 9
      migrations/postgresql/2020-08-02-025026_add_favorites_table_fix/up.sql
  9. 8
      migrations/postgresql/2021-03-11-190243_add_sends/up.sql
  10. 2
      migrations/postgresql/2021-04-30-233251_add_reprompt/up.sql
  11. 6
      migrations/postgresql/2021-08-30-193501_create_emergency_access/up.sql
  12. 4
      migrations/postgresql/2022-10-18-170602_add_events/up.sql
  13. 4
      migrations/postgresql/2023-01-31-222222_add_argon2/up.sql
  14. 2
      migrations/postgresql/2023-06-02-200424_create_organization_api_key/up.sql
  15. 2
      migrations/postgresql/2023-06-17-200424_create_auth_requests_table/up.sql
  16. 2
      migrations/postgresql/2024-09-04-091351_use_device_type_for_mails/up.sql

18
migrations/postgresql/2019-09-12-100000_create_tables/up.sql

@ -6,7 +6,7 @@ CREATE TABLE users (
name TEXT NOT NULL,
password_hash BYTEA NOT NULL,
salt BYTEA NOT NULL,
password_iterations INTEGER NOT NULL,
password_iterations INT4 NOT NULL,
password_hint TEXT,
akey TEXT NOT NULL,
private_key TEXT,
@ -16,8 +16,8 @@ CREATE TABLE users (
security_stamp TEXT NOT NULL,
equivalent_domains TEXT NOT NULL,
excluded_globals TEXT NOT NULL,
client_kdf_type INTEGER NOT NULL DEFAULT 0,
client_kdf_iter INTEGER NOT NULL DEFAULT 100000
client_kdf_type INT4 NOT NULL DEFAULT 0,
client_kdf_iter INT4 NOT NULL DEFAULT 100000
);
CREATE TABLE devices (
@ -26,7 +26,7 @@ CREATE TABLE devices (
updated_at TIMESTAMP NOT NULL,
user_uuid CHAR(36) NOT NULL REFERENCES users (uuid),
name TEXT NOT NULL,
atype INTEGER NOT NULL,
atype INT4 NOT NULL,
push_token TEXT,
refresh_token TEXT NOT NULL,
twofactor_remember TEXT
@ -44,7 +44,7 @@ CREATE TABLE ciphers (
updated_at TIMESTAMP NOT NULL,
user_uuid CHAR(36) REFERENCES users (uuid),
organization_uuid CHAR(36) REFERENCES organizations (uuid),
atype INTEGER NOT NULL,
atype INT4 NOT NULL,
name TEXT NOT NULL,
notes TEXT,
fields TEXT,
@ -57,7 +57,7 @@ CREATE TABLE attachments (
id CHAR(36) NOT NULL PRIMARY KEY,
cipher_uuid CHAR(36) NOT NULL REFERENCES ciphers (uuid),
file_name TEXT NOT NULL,
file_size INTEGER NOT NULL,
file_size INT4 NOT NULL,
akey TEXT
);
@ -89,8 +89,8 @@ CREATE TABLE users_organizations (
access_all BOOLEAN NOT NULL,
akey TEXT NOT NULL,
status INTEGER NOT NULL,
atype INTEGER NOT NULL,
status INT4 NOT NULL,
atype INT4 NOT NULL,
UNIQUE (user_uuid, org_uuid)
);
@ -110,7 +110,7 @@ CREATE TABLE ciphers_collections (
CREATE TABLE twofactor (
uuid CHAR(36) NOT NULL PRIMARY KEY,
user_uuid CHAR(36) NOT NULL REFERENCES users (uuid),
atype INTEGER NOT NULL,
atype INT4 NOT NULL,
enabled BOOLEAN NOT NULL,
data TEXT NOT NULL,
UNIQUE (user_uuid, atype)

2
migrations/postgresql/2019-10-10-083032_add_column_to_twofactor/up.sql

@ -1 +1 @@
ALTER TABLE twofactor ADD COLUMN last_used INTEGER NOT NULL DEFAULT 0;
ALTER TABLE twofactor ADD COLUMN last_used INT4 NOT NULL DEFAULT 0;

2
migrations/postgresql/2019-11-17-011009_add_email_verification/up.sql

@ -1,5 +1,5 @@
ALTER TABLE users ADD COLUMN verified_at TIMESTAMP DEFAULT NULL;
ALTER TABLE users ADD COLUMN last_verifying_at TIMESTAMP DEFAULT NULL;
ALTER TABLE users ADD COLUMN login_verify_count INTEGER NOT NULL DEFAULT 0;
ALTER TABLE users ADD COLUMN login_verify_count INT4 NOT NULL DEFAULT 0;
ALTER TABLE users ADD COLUMN email_new VARCHAR(255) DEFAULT NULL;
ALTER TABLE users ADD COLUMN email_new_token VARCHAR(16) DEFAULT NULL;

2
migrations/postgresql/2020-03-13-205045_add_policy_table/up.sql

@ -1,7 +1,7 @@
CREATE TABLE org_policies (
uuid CHAR(36) NOT NULL PRIMARY KEY,
org_uuid CHAR(36) NOT NULL REFERENCES organizations (uuid),
atype INTEGER NOT NULL,
atype INT4 NOT NULL,
enabled BOOLEAN NOT NULL,
data TEXT NOT NULL,

12
migrations/postgresql/2020-08-02-025025_add_favorites_table/down.sql

@ -1,13 +1 @@
ALTER TABLE ciphers
ADD COLUMN favorite BOOLEAN NOT NULL DEFAULT FALSE;
-- Transfer favorite status for user-owned ciphers.
UPDATE ciphers
SET favorite = TRUE
WHERE EXISTS (
SELECT * FROM favorites
WHERE favorites.user_uuid = ciphers.user_uuid
AND favorites.cipher_uuid = ciphers.uuid
);
DROP TABLE favorites;

10
migrations/postgresql/2020-08-02-025025_add_favorites_table/up.sql

@ -4,13 +4,3 @@ CREATE TABLE favorites (
PRIMARY KEY (user_uuid, cipher_uuid)
);
-- Transfer favorite status for user-owned ciphers.
INSERT INTO favorites(user_uuid, cipher_uuid)
SELECT user_uuid, uuid
FROM ciphers
WHERE favorite = TRUE
AND user_uuid IS NOT NULL;
ALTER TABLE ciphers
DROP COLUMN favorite;

11
migrations/postgresql/2020-08-02-025026_add_favorites_table_fix/down.sql

@ -0,0 +1,11 @@
ALTER TABLE ciphers
ADD COLUMN favorite BOOLEAN NOT NULL DEFAULT FALSE;
-- Transfer favorite status for user-owned ciphers.
UPDATE ciphers
SET favorite = TRUE
WHERE EXISTS (
SELECT * FROM favorites
WHERE favorites.user_uuid = ciphers.user_uuid
AND favorites.cipher_uuid = ciphers.uuid
);

9
migrations/postgresql/2020-08-02-025026_add_favorites_table_fix/up.sql

@ -0,0 +1,9 @@
-- Transfer favorite status for user-owned ciphers.
INSERT INTO favorites(user_uuid, cipher_uuid)
SELECT user_uuid, uuid
FROM ciphers
WHERE favorite = TRUE
AND user_uuid IS NOT NULL;
ALTER TABLE ciphers
DROP COLUMN favorite;

8
migrations/postgresql/2021-03-11-190243_add_sends/up.sql

@ -6,15 +6,15 @@ CREATE TABLE sends (
name TEXT NOT NULL,
notes TEXT,
atype INTEGER NOT NULL,
atype INT4 NOT NULL,
data TEXT NOT NULL,
key TEXT NOT NULL,
password_hash BYTEA,
password_salt BYTEA,
password_iter INTEGER,
password_iter INT4,
max_access_count INTEGER,
access_count INTEGER NOT NULL,
max_access_count INT4,
access_count INT4 NOT NULL,
creation_date TIMESTAMP NOT NULL,
revision_date TIMESTAMP NOT NULL,

2
migrations/postgresql/2021-04-30-233251_add_reprompt/up.sql

@ -1,2 +1,2 @@
ALTER TABLE ciphers
ADD COLUMN reprompt INTEGER;
ADD COLUMN reprompt INT4;

6
migrations/postgresql/2021-08-30-193501_create_emergency_access/up.sql

@ -4,9 +4,9 @@ CREATE TABLE emergency_access (
grantee_uuid CHAR(36) REFERENCES users (uuid),
email VARCHAR(255),
key_encrypted TEXT,
atype INTEGER NOT NULL,
status INTEGER NOT NULL,
wait_time_days INTEGER NOT NULL,
atype INT4 NOT NULL,
status INT4 NOT NULL,
wait_time_days INT4 NOT NULL,
recovery_initiated_at TIMESTAMP,
last_notification_at TIMESTAMP,
updated_at TIMESTAMP NOT NULL,

4
migrations/postgresql/2022-10-18-170602_add_events/up.sql

@ -1,6 +1,6 @@
CREATE TABLE event (
uuid CHAR(36) NOT NULL PRIMARY KEY,
event_type INTEGER NOT NULL,
event_type INT4 NOT NULL,
user_uuid CHAR(36),
org_uuid CHAR(36),
cipher_uuid CHAR(36),
@ -8,7 +8,7 @@ CREATE TABLE event (
group_uuid CHAR(36),
org_user_uuid CHAR(36),
act_user_uuid CHAR(36),
device_type INTEGER,
device_type INT4,
ip_address TEXT,
event_date TIMESTAMP NOT NULL,
policy_uuid CHAR(36),

4
migrations/postgresql/2023-01-31-222222_add_argon2/up.sql

@ -1,7 +1,7 @@
ALTER TABLE users
ADD COLUMN
client_kdf_memory INTEGER DEFAULT NULL;
client_kdf_memory INT4 DEFAULT NULL;
ALTER TABLE users
ADD COLUMN
client_kdf_parallelism INTEGER DEFAULT NULL;
client_kdf_parallelism INT4 DEFAULT NULL;

2
migrations/postgresql/2023-06-02-200424_create_organization_api_key/up.sql

@ -1,7 +1,7 @@
CREATE TABLE organization_api_key (
uuid CHAR(36) NOT NULL,
org_uuid CHAR(36) NOT NULL REFERENCES organizations(uuid),
atype INTEGER NOT NULL,
atype INT4 NOT NULL,
api_key VARCHAR(255),
revision_date TIMESTAMP NOT NULL,
PRIMARY KEY(uuid, org_uuid)

2
migrations/postgresql/2023-06-17-200424_create_auth_requests_table/up.sql

@ -3,7 +3,7 @@ CREATE TABLE auth_requests (
user_uuid CHAR(36) NOT NULL,
organization_uuid CHAR(36),
request_device_identifier CHAR(36) NOT NULL,
device_type INTEGER NOT NULL,
device_type INT4 NOT NULL,
request_ip TEXT NOT NULL,
response_device_id CHAR(36),
access_code TEXT NOT NULL,

2
migrations/postgresql/2024-09-04-091351_use_device_type_for_mails/up.sql

@ -1 +1 @@
ALTER TABLE twofactor_incomplete ADD COLUMN device_type INTEGER NOT NULL DEFAULT 14; -- 14 = Unknown Browser
ALTER TABLE twofactor_incomplete ADD COLUMN device_type INT4 NOT NULL DEFAULT 14; -- 14 = Unknown Browser

Loading…
Cancel
Save