Skip to content

Commit

Permalink
chore: user_type 컬럼 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
Xvezda committed May 7, 2024
1 parent 40c47da commit c30ba4d
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 62 deletions.
12 changes: 12 additions & 0 deletions apps/api/drizzle/0000_marvelous_christian_walker.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
CREATE TABLE `users` (
`id` integer PRIMARY KEY AUTOINCREMENT NOT NULL,
`user_id` text NOT NULL,
`user_name` text NOT NULL,
`user_image` text,
`user_type` text NOT NULL,
`created_at` integer NOT NULL,
`updated_at` integer NOT NULL
);
--> statement-breakpoint
CREATE UNIQUE INDEX `idx_users_user_id` ON `users` (`user_id`);--> statement-breakpoint
CREATE INDEX `idx_users_user_name` ON `users` (`user_name`);
17 changes: 0 additions & 17 deletions apps/api/drizzle/0000_stale_doorman.sql

This file was deleted.

51 changes: 8 additions & 43 deletions apps/api/drizzle/meta/0000_snapshot.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"version": "5",
"dialect": "sqlite",
"id": "adb7d579-e149-4d0e-9c32-f5c0f77d5f8a",
"id": "21a996cf-3dbe-41e4-b796-aeae28f4e6fd",
"prevId": "00000000-0000-0000-0000-000000000000",
"tables": {
"users": {
Expand Down Expand Up @@ -35,6 +35,13 @@
"notNull": false,
"autoincrement": false
},
"user_type": {
"name": "user_type",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"created_at": {
"name": "created_at",
"type": "integer",
Expand All @@ -48,34 +55,6 @@
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"access_token": {
"name": "access_token",
"type": "text",
"primaryKey": false,
"notNull": false,
"autoincrement": false
},
"refresh_token": {
"name": "refresh_token",
"type": "text",
"primaryKey": false,
"notNull": false,
"autoincrement": false
},
"token_type": {
"name": "token_type",
"type": "text",
"primaryKey": false,
"notNull": false,
"autoincrement": false
},
"expire_at": {
"name": "expire_at",
"type": "integer",
"primaryKey": false,
"notNull": false,
"autoincrement": false
}
},
"indexes": {
Expand All @@ -92,20 +71,6 @@
"user_name"
],
"isUnique": false
},
"idx_users_created_at": {
"name": "idx_users_created_at",
"columns": [
"created_at"
],
"isUnique": false
},
"idx_users_updated_at": {
"name": "idx_users_updated_at",
"columns": [
"updated_at"
],
"isUnique": false
}
},
"foreignKeys": {},
Expand Down
4 changes: 2 additions & 2 deletions apps/api/drizzle/meta/_journal.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
{
"idx": 0,
"version": "5",
"when": 1713153522431,
"tag": "0000_stale_doorman",
"when": 1715078125961,
"tag": "0000_marvelous_christian_walker",
"breakpoints": true
}
]
Expand Down
1 change: 1 addition & 0 deletions apps/api/src/db/schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ export const users = sqliteTable('users', {
userId: text('user_id').notNull(),
userName: text('user_name').notNull(),
userImage: text('user_image'),
userType: text('user_type').notNull(),
createdAt: integer('created_at', { mode: 'timestamp_ms' }).notNull(),
updatedAt: integer('updated_at', { mode: 'timestamp_ms' }).notNull(),
}, (table) => {
Expand Down
1 change: 1 addition & 0 deletions apps/api/src/services/auth/v1/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -396,6 +396,7 @@ app.get('/callback', async (c) => {
userId: meResult.response.id,
userName: meResult.response.nickname,
userImage: meResult.response.profile_image,
userType: 'normal',
createdAt: now,
updatedAt: now,
});
Expand Down

0 comments on commit c30ba4d

Please sign in to comment.