Skip to content

Commit

Permalink
Add Car and User tables to database
Browse files Browse the repository at this point in the history
  • Loading branch information
Timothy Miller committed Nov 4, 2023
1 parent 21bf2e9 commit a6f5fee
Show file tree
Hide file tree
Showing 3 changed files with 132 additions and 0 deletions.
16 changes: 16 additions & 0 deletions packages/api/migrations/0003_hot_ultragirl.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
CREATE TABLE `Car` (
`id` text PRIMARY KEY NOT NULL,
`make` text NOT NULL,
`model` text NOT NULL,
`year` integer NOT NULL,
`color` text NOT NULL,
`price` real NOT NULL,
`mileage` integer NOT NULL,
`fuelType` text NOT NULL,
`transmission` text NOT NULL
);
--> statement-breakpoint
CREATE TABLE `User` (
`id` text PRIMARY KEY NOT NULL,
`email` text NOT NULL
);
109 changes: 109 additions & 0 deletions packages/api/migrations/meta/0003_snapshot.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
{
"version": "5",
"dialect": "sqlite",
"id": "48283c30-3c21-4114-9533-2235c17d08b9",
"prevId": "4dc9ecc7-da6d-4edc-841b-2d44a349d363",
"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": {}
},
"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 @@ -22,6 +22,13 @@
"when": 1699066590780,
"tag": "0002_faithful_gravity",
"breakpoints": true
},
{
"idx": 3,
"version": "5",
"when": 1699079033736,
"tag": "0003_hot_ultragirl",
"breakpoints": true
}
]
}

0 comments on commit a6f5fee

Please sign in to comment.