Fix UUID types in Postgres migrations
Diff
migrations/postgres/2021-08-31-214501_create_crates_table/up.sql | 6 ++++--
migrations/postgres/2021-11-08-005634_update_sessions_add_uuid/up.sql | 2 +-
2 files changed, 4 insertions(+), 4 deletions(-)
@@ -1,6 +1,6 @@
CREATE TABLE users (
id INTEGER PRIMARY KEY GENERATED ALWAYS AS IDENTITY,
uuid UUID NOT NULL UNIQUE,
uuid BYTEA NOT NULL UNIQUE,
username VARCHAR(255) NOT NULL UNIQUE,
password CHAR(60),
name VARCHAR(255),
@@ -12,7 +12,7 @@
CREATE TABLE organisations (
id INTEGER PRIMARY KEY GENERATED ALWAYS AS IDENTITY,
uuid UUID NOT NULL UNIQUE,
uuid BYTEA NOT NULL UNIQUE,
name VARCHAR(255) NOT NULL UNIQUE,
description TEXT NOT NULL DEFAULT '',
public BOOLEAN NOT NULL DEFAULT FALSE
@@ -73,7 +73,7 @@
CREATE TABLE user_ssh_keys (
id INTEGER PRIMARY KEY GENERATED ALWAYS AS IDENTITY,
uuid UUID NOT NULL UNIQUE,
uuid BYTEA NOT NULL UNIQUE,
name VARCHAR(255) NOT NULL,
user_id INTEGER NOT NULL,
ssh_key BYTEA NOT NULL UNIQUE,
@@ -1,5 +1,5 @@
DELETE FROM user_sessions;
ALTER TABLE user_sessions ADD COLUMN uuid UUID NOT NULL;
ALTER TABLE user_sessions ADD COLUMN uuid BYTEA NOT NULL;
CREATE UNIQUE INDEX unique_user_sessions_uuid ON user_sessions(uuid);