split db schema
This commit is contained in:
@@ -2,21 +2,13 @@ import { relations, sql } from "drizzle-orm";
|
||||
import {
|
||||
index,
|
||||
integer,
|
||||
pgTableCreator,
|
||||
primaryKey,
|
||||
text,
|
||||
timestamp,
|
||||
varchar,
|
||||
} from "drizzle-orm/pg-core";
|
||||
import { type AdapterAccount } from "next-auth/adapters";
|
||||
|
||||
/**
|
||||
* This is an example of how to use the multi-project schema feature of Drizzle ORM. Use the same
|
||||
* database instance for multiple projects.
|
||||
*
|
||||
* @see https://orm.drizzle.team/docs/goodies#multi-project-schema
|
||||
*/
|
||||
export const createTable = pgTableCreator((name) => `ls_${name}`);
|
||||
import { createTable } from "~/server/db/schema/create-table";
|
||||
|
||||
export const users = createTable("user", {
|
||||
id: varchar("id", { length: 255 })
|
||||
9
src/server/db/schema/create-table.ts
Normal file
9
src/server/db/schema/create-table.ts
Normal file
@@ -0,0 +1,9 @@
|
||||
import { pgTableCreator } from "drizzle-orm/pg-core";
|
||||
|
||||
/**
|
||||
* This is an example of how to use the multi-project schema feature of Drizzle ORM. Use the same
|
||||
* database instance for multiple projects.
|
||||
*
|
||||
* @see https://orm.drizzle.team/docs/goodies#multi-project-schema
|
||||
*/
|
||||
export const createTable = pgTableCreator((name) => `ls_${name}`);
|
||||
1
src/server/db/schema/index.ts
Normal file
1
src/server/db/schema/index.ts
Normal file
@@ -0,0 +1 @@
|
||||
export * from "./auth";
|
||||
Reference in New Issue
Block a user