feat(15-01): remove users and sessions tables from schema
- Delete users and sessions table definitions from src/db/schema.ts - Generate Drizzle migration to drop both tables - Retain apiKeys, oauthClients, oauthCodes, oauthTokens tables
This commit is contained in:
2
drizzle/0010_foamy_marvel_zombies.sql
Normal file
2
drizzle/0010_foamy_marvel_zombies.sql
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
DROP TABLE `sessions`;--> statement-breakpoint
|
||||||
|
DROP TABLE `users`;
|
||||||
@@ -71,6 +71,13 @@
|
|||||||
"when": 1775287060443,
|
"when": 1775287060443,
|
||||||
"tag": "0009_happy_mockingbird",
|
"tag": "0009_happy_mockingbird",
|
||||||
"breakpoints": true
|
"breakpoints": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"idx": 10,
|
||||||
|
"version": "6",
|
||||||
|
"when": 1775327900426,
|
||||||
|
"tag": "0010_foamy_marvel_zombies",
|
||||||
|
"breakpoints": true
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
@@ -100,23 +100,6 @@ export const settings = sqliteTable("settings", {
|
|||||||
value: text("value").notNull(),
|
value: text("value").notNull(),
|
||||||
});
|
});
|
||||||
|
|
||||||
export const users = sqliteTable("users", {
|
|
||||||
id: integer("id").primaryKey({ autoIncrement: true }),
|
|
||||||
username: text("username").notNull().unique(),
|
|
||||||
passwordHash: text("password_hash").notNull(),
|
|
||||||
createdAt: integer("created_at", { mode: "timestamp" })
|
|
||||||
.notNull()
|
|
||||||
.$defaultFn(() => new Date()),
|
|
||||||
});
|
|
||||||
|
|
||||||
export const sessions = sqliteTable("sessions", {
|
|
||||||
id: text("id").primaryKey(),
|
|
||||||
userId: integer("user_id")
|
|
||||||
.notNull()
|
|
||||||
.references(() => users.id, { onDelete: "cascade" }),
|
|
||||||
expiresAt: integer("expires_at", { mode: "timestamp" }).notNull(),
|
|
||||||
});
|
|
||||||
|
|
||||||
export const apiKeys = sqliteTable("api_keys", {
|
export const apiKeys = sqliteTable("api_keys", {
|
||||||
id: integer("id").primaryKey({ autoIncrement: true }),
|
id: integer("id").primaryKey({ autoIncrement: true }),
|
||||||
name: text("name").notNull(),
|
name: text("name").notNull(),
|
||||||
|
|||||||
Reference in New Issue
Block a user