Skip to content

Commit

Permalink
Add Test table to schema
Browse files Browse the repository at this point in the history
  • Loading branch information
timothymiller committed Sep 16, 2023
1 parent 329e869 commit 719afcd
Show file tree
Hide file tree
Showing 4 changed files with 148 additions and 0 deletions.
4 changes: 4 additions & 0 deletions packages/api/migrations/0001_worried_gamma_corps.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
CREATE TABLE `Test` (
`id` text PRIMARY KEY NOT NULL,
`name` text NOT NULL
);
132 changes: 132 additions & 0 deletions packages/api/migrations/meta/0001_snapshot.json
Original file line number Diff line number Diff line change
@@ -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": {}
}
}
7 changes: 7 additions & 0 deletions packages/api/migrations/meta/_journal.json
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
]
}
5 changes: 5 additions & 0 deletions packages/api/src/db/schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,8 @@ export const CarTable = sqliteTable('Car', {
export type Car = InferSelectModel<typeof CarTable>
export type InsertCar = InferInsertModel<typeof CarTable>
export const CarSchema = createInsertSchema(CarTable)

export const TestTable = sqliteTable('Test', {
id: text('id').primaryKey(),
name: text('name').notNull(),
})

0 comments on commit 719afcd

Please sign in to comment.