diff --git a/migrations/0000_wild_revanche.sql b/migrations/0000_wild_revanche.sql new file mode 100644 index 0000000..6b22533 --- /dev/null +++ b/migrations/0000_wild_revanche.sql @@ -0,0 +1,14 @@ +-- Current sql file was generated after introspecting the database +-- If you want to run this migration please uncomment this code before executing migrations +/* +CREATE TABLE `foo` ( + `bar` text DEFAULT 'Hey!' NOT NULL +); +--> statement-breakpoint +CREATE TABLE `__drizzle_migrations` ( + `id` numeric PRIMARY KEY, + `hash` text NOT NULL, + `created_at` numeric +); + +*/ \ No newline at end of file diff --git a/migrations/meta/0000_snapshot.json b/migrations/meta/0000_snapshot.json new file mode 100644 index 0000000..61c87fd --- /dev/null +++ b/migrations/meta/0000_snapshot.json @@ -0,0 +1,61 @@ +{ + "id": "00000000-0000-0000-0000-000000000000", + "prevId": "", + "version": "5", + "dialect": "sqlite", + "tables": { + "foo": { + "name": "foo", + "columns": { + "bar": { + "default": "'Hey!'", + "autoincrement": false, + "name": "bar", + "type": "text", + "primaryKey": false, + "notNull": true + } + }, + "compositePrimaryKeys": {}, + "indexes": {}, + "foreignKeys": {}, + "uniqueConstraints": {} + }, + "__drizzle_migrations": { + "name": "__drizzle_migrations", + "columns": { + "id": { + "autoincrement": false, + "name": "id", + "type": "numeric", + "primaryKey": true, + "notNull": false + }, + "hash": { + "autoincrement": false, + "name": "hash", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "autoincrement": false, + "name": "created_at", + "type": "numeric", + "primaryKey": false, + "notNull": false + } + }, + "compositePrimaryKeys": {}, + "indexes": {}, + "foreignKeys": {}, + "uniqueConstraints": {} + } + }, + "enums": {}, + "_meta": { + "schemas": {}, + "tables": {}, + "columns": {} + } +} \ No newline at end of file diff --git a/migrations/meta/_journal.json b/migrations/meta/_journal.json new file mode 100644 index 0000000..448dfad --- /dev/null +++ b/migrations/meta/_journal.json @@ -0,0 +1,13 @@ +{ + "version": "5", + "dialect": "sqlite", + "entries": [ + { + "idx": 0, + "version": "5", + "when": 1714268627357, + "tag": "0000_wild_revanche", + "breakpoints": true + } + ] +} \ No newline at end of file diff --git a/migrations/schema.ts b/migrations/schema.ts new file mode 100644 index 0000000..3942509 --- /dev/null +++ b/migrations/schema.ts @@ -0,0 +1,12 @@ +import { sqliteTable, AnySQLiteColumn, text, numeric } from "drizzle-orm/sqlite-core" + import { sql } from "drizzle-orm" + +export const foo = sqliteTable("foo", { + bar: text("bar").default("Hey!").notNull(), +}); + +export const drizzleMigrations = sqliteTable("__drizzle_migrations", { + id: numeric("id").primaryKey(), + hash: text("hash").notNull(), + createdAt: numeric("created_at"), +}); \ No newline at end of file