diff --git a/packages/api/migrations/0001_worried_gamma_corps.sql b/packages/api/migrations/0001_worried_gamma_corps.sql new file mode 100644 index 000000000..adcf9c39c --- /dev/null +++ b/packages/api/migrations/0001_worried_gamma_corps.sql @@ -0,0 +1,4 @@ +CREATE TABLE `Test` ( + `id` text PRIMARY KEY NOT NULL, + `name` text NOT NULL +); diff --git a/packages/api/migrations/meta/0001_snapshot.json b/packages/api/migrations/meta/0001_snapshot.json new file mode 100644 index 000000000..bf51d97a3 --- /dev/null +++ b/packages/api/migrations/meta/0001_snapshot.json @@ -0,0 +1,132 @@ +{ + "version": "5", + "dialect": "sqlite", + "id": "19d05176-7733-4654-b24f-799d3fddc19c", + "prevId": "b4ee64d5-7b72-4828-8645-33c41f0af619", + "tables": { + "Car": { + "name": "Car", + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true, + "autoincrement": false + }, + "make": { + "name": "make", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "model": { + "name": "model", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "year": { + "name": "year", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "color": { + "name": "color", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "price": { + "name": "price", + "type": "real", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "mileage": { + "name": "mileage", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "fuelType": { + "name": "fuelType", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "transmission": { + "name": "transmission", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {} + }, + "Test": { + "name": "Test", + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true, + "autoincrement": false + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {} + }, + "User": { + "name": "User", + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true, + "autoincrement": false + }, + "email": { + "name": "email", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {} + } + }, + "enums": {}, + "_meta": { + "schemas": {}, + "tables": {}, + "columns": {} + } +} \ No newline at end of file diff --git a/packages/api/migrations/meta/_journal.json b/packages/api/migrations/meta/_journal.json index 11ae0c95e..080b5738d 100644 --- a/packages/api/migrations/meta/_journal.json +++ b/packages/api/migrations/meta/_journal.json @@ -8,6 +8,13 @@ "when": 1692862097376, "tag": "0000_chemical_spitfire", "breakpoints": true + }, + { + "idx": 1, + "version": "5", + "when": 1694824497981, + "tag": "0001_worried_gamma_corps", + "breakpoints": true } ] } \ No newline at end of file diff --git a/packages/api/src/db/schema.ts b/packages/api/src/db/schema.ts index 2fe870bb9..b77cd2fd6 100644 --- a/packages/api/src/db/schema.ts +++ b/packages/api/src/db/schema.ts @@ -28,3 +28,8 @@ export const CarTable = sqliteTable('Car', { export type Car = InferSelectModel export type InsertCar = InferInsertModel export const CarSchema = createInsertSchema(CarTable) + +export const TestTable = sqliteTable('Test', { + id: text('id').primaryKey(), + name: text('name').notNull(), +})