Skip to content
This repository was archived by the owner on Sep 17, 2024. It is now read-only.

Commit 4381160

Browse files
authored
chore: generate migrations (#146)
1 parent d03bd83 commit 4381160

24 files changed

+879
-0
lines changed
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
CREATE SCHEMA "module_auth_email";
2+
--> statement-breakpoint
3+
CREATE TABLE IF NOT EXISTS "module_auth_email"."verifications" (
4+
"id" uuid PRIMARY KEY DEFAULT gen_random_uuid() NOT NULL,
5+
"email" text NOT NULL,
6+
"code" text NOT NULL,
7+
"token" text NOT NULL,
8+
"attempt_count" integer DEFAULT 0 NOT NULL,
9+
"max_attempt_count" integer NOT NULL,
10+
"created_at" timestamp DEFAULT now() NOT NULL,
11+
"expire_at" timestamp NOT NULL,
12+
"completed_at" timestamp,
13+
CONSTRAINT "verifications_code_unique" UNIQUE("code"),
14+
CONSTRAINT "verifications_token_unique" UNIQUE("token")
15+
);
Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
{
2+
"id": "9c7e6120-edaf-4441-880b-a2a1c21f20e3",
3+
"prevId": "00000000-0000-0000-0000-000000000000",
4+
"version": "7",
5+
"dialect": "postgresql",
6+
"tables": {
7+
"module_auth_email.verifications": {
8+
"name": "verifications",
9+
"schema": "module_auth_email",
10+
"columns": {
11+
"id": {
12+
"name": "id",
13+
"type": "uuid",
14+
"primaryKey": true,
15+
"notNull": true,
16+
"default": "gen_random_uuid()"
17+
},
18+
"email": {
19+
"name": "email",
20+
"type": "text",
21+
"primaryKey": false,
22+
"notNull": true
23+
},
24+
"code": {
25+
"name": "code",
26+
"type": "text",
27+
"primaryKey": false,
28+
"notNull": true
29+
},
30+
"token": {
31+
"name": "token",
32+
"type": "text",
33+
"primaryKey": false,
34+
"notNull": true
35+
},
36+
"attempt_count": {
37+
"name": "attempt_count",
38+
"type": "integer",
39+
"primaryKey": false,
40+
"notNull": true,
41+
"default": 0
42+
},
43+
"max_attempt_count": {
44+
"name": "max_attempt_count",
45+
"type": "integer",
46+
"primaryKey": false,
47+
"notNull": true
48+
},
49+
"created_at": {
50+
"name": "created_at",
51+
"type": "timestamp",
52+
"primaryKey": false,
53+
"notNull": true,
54+
"default": "now()"
55+
},
56+
"expire_at": {
57+
"name": "expire_at",
58+
"type": "timestamp",
59+
"primaryKey": false,
60+
"notNull": true
61+
},
62+
"completed_at": {
63+
"name": "completed_at",
64+
"type": "timestamp",
65+
"primaryKey": false,
66+
"notNull": false
67+
}
68+
},
69+
"indexes": {},
70+
"foreignKeys": {},
71+
"compositePrimaryKeys": {},
72+
"uniqueConstraints": {
73+
"verifications_code_unique": {
74+
"name": "verifications_code_unique",
75+
"nullsNotDistinct": false,
76+
"columns": [
77+
"code"
78+
]
79+
},
80+
"verifications_token_unique": {
81+
"name": "verifications_token_unique",
82+
"nullsNotDistinct": false,
83+
"columns": [
84+
"token"
85+
]
86+
}
87+
}
88+
}
89+
},
90+
"enums": {},
91+
"schemas": {
92+
"module_auth_email": "module_auth_email"
93+
},
94+
"sequences": {},
95+
"_meta": {
96+
"columns": {},
97+
"schemas": {},
98+
"tables": {}
99+
}
100+
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"version": "7",
3+
"dialect": "postgresql",
4+
"entries": [
5+
{
6+
"idx": 0,
7+
"version": "7",
8+
"when": 1724526776986,
9+
"tag": "1724526776_powerful_maverick",
10+
"breakpoints": true
11+
}
12+
]
13+
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
CREATE SCHEMA "module_currency";
2+
--> statement-breakpoint
3+
CREATE TABLE IF NOT EXISTS "module_currency"."user_wallets" (
4+
"user_id" uuid PRIMARY KEY DEFAULT gen_random_uuid() NOT NULL,
5+
"balance" integer NOT NULL
6+
);
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
{
2+
"id": "9815911d-8a08-403c-b26b-28dbb3335232",
3+
"prevId": "00000000-0000-0000-0000-000000000000",
4+
"version": "7",
5+
"dialect": "postgresql",
6+
"tables": {
7+
"module_currency.user_wallets": {
8+
"name": "user_wallets",
9+
"schema": "module_currency",
10+
"columns": {
11+
"user_id": {
12+
"name": "user_id",
13+
"type": "uuid",
14+
"primaryKey": true,
15+
"notNull": true,
16+
"default": "gen_random_uuid()"
17+
},
18+
"balance": {
19+
"name": "balance",
20+
"type": "integer",
21+
"primaryKey": false,
22+
"notNull": true
23+
}
24+
},
25+
"indexes": {},
26+
"foreignKeys": {},
27+
"compositePrimaryKeys": {},
28+
"uniqueConstraints": {}
29+
}
30+
},
31+
"enums": {},
32+
"schemas": {
33+
"module_currency": "module_currency"
34+
},
35+
"sequences": {},
36+
"_meta": {
37+
"columns": {},
38+
"schemas": {},
39+
"tables": {}
40+
}
41+
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"version": "7",
3+
"dialect": "postgresql",
4+
"entries": [
5+
{
6+
"idx": 0,
7+
"version": "7",
8+
"when": 1724526791080,
9+
"tag": "1724526791_nostalgic_dust",
10+
"breakpoints": true
11+
}
12+
]
13+
}
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
CREATE SCHEMA "module_friends";
2+
--> statement-breakpoint
3+
CREATE TABLE IF NOT EXISTS "module_friends"."friend_requests" (
4+
"id" uuid PRIMARY KEY DEFAULT gen_random_uuid() NOT NULL,
5+
"sender_user_id" uuid NOT NULL,
6+
"target_user_id" uuid NOT NULL,
7+
"created_at" timestamp DEFAULT now() NOT NULL,
8+
"declined_at" timestamp,
9+
"accepted_at" timestamp
10+
);
11+
--> statement-breakpoint
12+
CREATE TABLE IF NOT EXISTS "module_friends"."friends" (
13+
"user_id_a" uuid NOT NULL,
14+
"user_id_b" uuid NOT NULL,
15+
"friend_request_id" uuid NOT NULL,
16+
"created_at" timestamp DEFAULT now() NOT NULL,
17+
"removed_at" timestamp,
18+
CONSTRAINT "friends_user_id_a_user_id_b_pk" PRIMARY KEY("user_id_a","user_id_b")
19+
);
Lines changed: 115 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,115 @@
1+
{
2+
"id": "3ccb5a50-b0d1-46fd-bafb-75d366c4ce8f",
3+
"prevId": "00000000-0000-0000-0000-000000000000",
4+
"version": "7",
5+
"dialect": "postgresql",
6+
"tables": {
7+
"module_friends.friend_requests": {
8+
"name": "friend_requests",
9+
"schema": "module_friends",
10+
"columns": {
11+
"id": {
12+
"name": "id",
13+
"type": "uuid",
14+
"primaryKey": true,
15+
"notNull": true,
16+
"default": "gen_random_uuid()"
17+
},
18+
"sender_user_id": {
19+
"name": "sender_user_id",
20+
"type": "uuid",
21+
"primaryKey": false,
22+
"notNull": true
23+
},
24+
"target_user_id": {
25+
"name": "target_user_id",
26+
"type": "uuid",
27+
"primaryKey": false,
28+
"notNull": true
29+
},
30+
"created_at": {
31+
"name": "created_at",
32+
"type": "timestamp",
33+
"primaryKey": false,
34+
"notNull": true,
35+
"default": "now()"
36+
},
37+
"declined_at": {
38+
"name": "declined_at",
39+
"type": "timestamp",
40+
"primaryKey": false,
41+
"notNull": false
42+
},
43+
"accepted_at": {
44+
"name": "accepted_at",
45+
"type": "timestamp",
46+
"primaryKey": false,
47+
"notNull": false
48+
}
49+
},
50+
"indexes": {},
51+
"foreignKeys": {},
52+
"compositePrimaryKeys": {},
53+
"uniqueConstraints": {}
54+
},
55+
"module_friends.friends": {
56+
"name": "friends",
57+
"schema": "module_friends",
58+
"columns": {
59+
"user_id_a": {
60+
"name": "user_id_a",
61+
"type": "uuid",
62+
"primaryKey": false,
63+
"notNull": true
64+
},
65+
"user_id_b": {
66+
"name": "user_id_b",
67+
"type": "uuid",
68+
"primaryKey": false,
69+
"notNull": true
70+
},
71+
"friend_request_id": {
72+
"name": "friend_request_id",
73+
"type": "uuid",
74+
"primaryKey": false,
75+
"notNull": true
76+
},
77+
"created_at": {
78+
"name": "created_at",
79+
"type": "timestamp",
80+
"primaryKey": false,
81+
"notNull": true,
82+
"default": "now()"
83+
},
84+
"removed_at": {
85+
"name": "removed_at",
86+
"type": "timestamp",
87+
"primaryKey": false,
88+
"notNull": false
89+
}
90+
},
91+
"indexes": {},
92+
"foreignKeys": {},
93+
"compositePrimaryKeys": {
94+
"friends_user_id_a_user_id_b_pk": {
95+
"name": "friends_user_id_a_user_id_b_pk",
96+
"columns": [
97+
"user_id_a",
98+
"user_id_b"
99+
]
100+
}
101+
},
102+
"uniqueConstraints": {}
103+
}
104+
},
105+
"enums": {},
106+
"schemas": {
107+
"module_friends": "module_friends"
108+
},
109+
"sequences": {},
110+
"_meta": {
111+
"columns": {},
112+
"schemas": {},
113+
"tables": {}
114+
}
115+
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"version": "7",
3+
"dialect": "postgresql",
4+
"entries": [
5+
{
6+
"idx": 0,
7+
"version": "7",
8+
"when": 1724526792580,
9+
"tag": "1724526792_omniscient_jetstream",
10+
"breakpoints": true
11+
}
12+
]
13+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
CREATE SCHEMA "module_identities";
2+
--> statement-breakpoint
3+
CREATE TABLE IF NOT EXISTS "module_identities"."user_identities" (
4+
"user_id" uuid NOT NULL,
5+
"identity_type" text NOT NULL,
6+
"identity_id" text NOT NULL,
7+
"unique_data" jsonb NOT NULL,
8+
"additional_data" jsonb NOT NULL,
9+
CONSTRAINT "user_identities_user_id_identity_type_identity_id_pk" PRIMARY KEY("user_id","identity_type","identity_id"),
10+
CONSTRAINT "user_identities_identity_type_identity_id_unique_data_unique" UNIQUE("identity_type","identity_id","unique_data")
11+
);

0 commit comments

Comments
 (0)