Skip to content

Commit

Permalink
Include migrations
Browse files Browse the repository at this point in the history
  • Loading branch information
Lucas Bozzo authored and Lucas Bozzo committed Apr 28, 2024
1 parent 880ea90 commit f6bd8d6
Show file tree
Hide file tree
Showing 4 changed files with 100 additions and 0 deletions.
14 changes: 14 additions & 0 deletions migrations/0000_wild_revanche.sql
Original file line number Diff line number Diff line change
@@ -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
);
*/
61 changes: 61 additions & 0 deletions migrations/meta/0000_snapshot.json
Original file line number Diff line number Diff line change
@@ -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": {}
}
}
13 changes: 13 additions & 0 deletions migrations/meta/_journal.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"version": "5",
"dialect": "sqlite",
"entries": [
{
"idx": 0,
"version": "5",
"when": 1714268627357,
"tag": "0000_wild_revanche",
"breakpoints": true
}
]
}
12 changes: 12 additions & 0 deletions migrations/schema.ts
Original file line number Diff line number Diff line change
@@ -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"),
});

0 comments on commit f6bd8d6

Please sign in to comment.