Skip to content

Commit

Permalink
Add defaults to all new ids in tables
Browse files Browse the repository at this point in the history
  • Loading branch information
SylteA committed Oct 21, 2023
1 parent 72c74ed commit 75f8e6b
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions bot/models/migrations/004_up__levelling.sql
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
CREATE TABLE IF NOT EXISTS levelling_users
(
id BIGINT PRIMARY KEY,
id BIGINT PRIMARY KEY DEFAULT create_snowflake(),
guild_id BIGINT NOT NULL,
user_id BIGINT NOT NULL,
total_xp INT NOT NULL DEFAULT 0,
Expand All @@ -11,7 +11,7 @@ CREATE TABLE IF NOT EXISTS levelling_users

CREATE TABLE IF NOT EXISTS custom_roles
(
id BIGINT PRIMARY KEY,
id BIGINT PRIMARY KEY DEFAULT create_snowflake(),
guild_id BIGINT NOT NULL,
role_id BIGINT NOT NULL,
name VARCHAR NOT NULL,
Expand All @@ -22,7 +22,7 @@ CREATE TABLE IF NOT EXISTS custom_roles

CREATE TABLE IF NOT EXISTS levelling_roles
(
id SERIAL PRIMARY KEY,
id SERIAL PRIMARY KEY DEFAULT create_snowflake(),
required_xp INTEGER NOT NULL,
guild_id BIGINT NOT NULL,
role_id BIGINT NOT NULL REFERENCES custom_roles(role_id),
Expand All @@ -31,7 +31,7 @@ CREATE TABLE IF NOT EXISTS levelling_roles

CREATE TABLE IF NOT EXISTS persisted_roles
(
id SERIAL PRIMARY KEY,
id SERIAL PRIMARY KEY DEFAULT create_snowflake(),
guild_id BIGINT NOT NULL,
user_id BIGINT NOT NULL,
role_id BIGINT NOT NULL REFERENCES custom_roles(role_id),
Expand All @@ -41,7 +41,7 @@ CREATE TABLE IF NOT EXISTS persisted_roles

CREATE TABLE IF NOT EXISTS levelling_ignored_channels
(
id SERIAL PRIMARY KEY,
id SERIAL PRIMARY KEY DEFAULT create_snowflake(),
guild_id BIGINT NOT NULL,
channel_id BIGINT NOT NULL,
CONSTRAINT levelling_ignored_channels_guild_id_and_channel_id_key UNIQUE (guild_id, channel_id)
Expand Down

0 comments on commit 75f8e6b

Please sign in to comment.