mirror of
https://github.com/fsolla/teqo.git
synced 2026-12-03 13:53:06 +00:00
Auto-provision legal texts via migrations and db:seed:consent so local and production deploy stay fail-closed-ready; register O0+ simplify follow-ups.
18 lines
543 B
TypeScript
18 lines
543 B
TypeScript
import { MigrateDownArgs, MigrateUpArgs, sql } from '@payloadcms/db-postgres'
|
|
|
|
export async function up({ db }: MigrateUpArgs): Promise<void> {
|
|
await db.execute(sql`
|
|
CREATE TABLE "privacy_policy" (
|
|
"id" serial PRIMARY KEY NOT NULL,
|
|
"published" boolean DEFAULT false,
|
|
"body" jsonb NOT NULL,
|
|
"updated_at" timestamp(3) with time zone,
|
|
"created_at" timestamp(3) with time zone
|
|
);
|
|
`)
|
|
}
|
|
|
|
export async function down({ db }: MigrateDownArgs): Promise<void> {
|
|
await db.execute(sql`
|
|
DROP TABLE "privacy_policy" CASCADE;`)
|
|
}
|