split db schema
This commit is contained in:
@@ -2,21 +2,13 @@ import { relations, sql } from "drizzle-orm";
|
|||||||
import {
|
import {
|
||||||
index,
|
index,
|
||||||
integer,
|
integer,
|
||||||
pgTableCreator,
|
|
||||||
primaryKey,
|
primaryKey,
|
||||||
text,
|
text,
|
||||||
timestamp,
|
timestamp,
|
||||||
varchar,
|
varchar,
|
||||||
} from "drizzle-orm/pg-core";
|
} from "drizzle-orm/pg-core";
|
||||||
import { type AdapterAccount } from "next-auth/adapters";
|
import { type AdapterAccount } from "next-auth/adapters";
|
||||||
|
import { createTable } from "~/server/db/schema/create-table";
|
||||||
/**
|
|
||||||
* 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}`);
|
|
||||||
|
|
||||||
export const users = createTable("user", {
|
export const users = createTable("user", {
|
||||||
id: varchar("id", { length: 255 })
|
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