create migrations
This commit is contained in:
parent
a912cf6233
commit
7ebbb211da
1
migrations/2025-04-02-141600_create_user/down.sql
Normal file
1
migrations/2025-04-02-141600_create_user/down.sql
Normal file
@ -0,0 +1 @@
|
|||||||
|
DROP TABLE users
|
||||||
5
migrations/2025-04-02-141600_create_user/up.sql
Normal file
5
migrations/2025-04-02-141600_create_user/up.sql
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
CREATE TABLE users (
|
||||||
|
id SERIAL PRIMARY KEY,
|
||||||
|
is_admin BOOLEAN NOT NULL DEFAULT FALSE
|
||||||
|
)
|
||||||
|
|
||||||
@ -0,0 +1,2 @@
|
|||||||
|
ALTER TABLE users
|
||||||
|
DROP COLUMN user_id;
|
||||||
2
migrations/2025-04-02-154126_add_userid_to_users/up.sql
Normal file
2
migrations/2025-04-02-154126_add_userid_to_users/up.sql
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
ALTER TABLE users
|
||||||
|
ADD COLUMN user_id BIGINT NOT NULL;
|
||||||
4
migrations/2025-04-02-163956_users_id_bigint/down.sql
Normal file
4
migrations/2025-04-02-163956_users_id_bigint/down.sql
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
ALTER TABLE users
|
||||||
|
ALTER COLUMN id TYPE integer;
|
||||||
|
ALTER TABLE users
|
||||||
|
ADD COLUMN user_id BIGINT NOT NULL;
|
||||||
4
migrations/2025-04-02-163956_users_id_bigint/up.sql
Normal file
4
migrations/2025-04-02-163956_users_id_bigint/up.sql
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
ALTER TABLE users
|
||||||
|
ALTER COLUMN id TYPE BIGINT;
|
||||||
|
ALTER TABLE users
|
||||||
|
DROP COLUMN user_id;
|
||||||
@ -0,0 +1,6 @@
|
|||||||
|
<<<<<<< HEAD
|
||||||
|
=======
|
||||||
|
ALTER TABLE users
|
||||||
|
ALTER COLUMN id TYPE BIGINT;
|
||||||
|
>>>>>>> Snippet
|
||||||
|
|
||||||
Loading…
x
Reference in New Issue
Block a user