Skip to content
Source
Sign inSign up
samwillis/neon-glow-demo
Open History to see the last commit

migrate.ts

8 lines582 Bytes

1import { config as loadEnv } from 'dotenv';
2import { database, migration } from './database.ts';
3​
4loadEnv({ path: new URL('../../../.env.local', import.meta.url), quiet: true });
5await database().query('CREATE TABLE IF NOT EXISTS "user"(id text PRIMARY KEY,name text NOT NULL,email text UNIQUE NOT NULL,"emailVerified" boolean NOT NULL DEFAULT false,"createdAt" timestamptz NOT NULL DEFAULT now(),"updatedAt" timestamptz NOT NULL DEFAULT now())');
6await database().query(migration);
7console.log('Glow schemas are up to date. Neon manages its Auth schema.');
8await database().end();