mirror of
https://github.com/ArthurDanjou/spanish-learner.git
synced 2026-01-14 12:14:39 +01:00
Init project
This commit is contained in:
11
server/database/migrations/0001_conscious_plazm.sql
Normal file
11
server/database/migrations/0001_conscious_plazm.sql
Normal file
@@ -0,0 +1,11 @@
|
||||
CREATE TABLE `words` (
|
||||
`id` integer PRIMARY KEY NOT NULL,
|
||||
`word` text DEFAULT '',
|
||||
`translation` text DEFAULT '',
|
||||
`created_at` text DEFAULT (CURRENT_DATE)
|
||||
);
|
||||
--> statement-breakpoint
|
||||
ALTER TABLE `users` RENAME TO `verbs`;--> statement-breakpoint
|
||||
ALTER TABLE `verbs` RENAME COLUMN `name` TO `verb`;--> statement-breakpoint
|
||||
ALTER TABLE `verbs` ADD `translation` text DEFAULT '';--> statement-breakpoint
|
||||
ALTER TABLE `verbs` ADD `type` text;
|
||||
108
server/database/migrations/meta/0001_snapshot.json
Normal file
108
server/database/migrations/meta/0001_snapshot.json
Normal file
@@ -0,0 +1,108 @@
|
||||
{
|
||||
"version": "6",
|
||||
"dialect": "sqlite",
|
||||
"id": "b47037ef-03cc-45d7-b297-e1d1b8dbf3fe",
|
||||
"prevId": "ef8e28cd-73a1-4801-9a0b-7e80169a57c0",
|
||||
"tables": {
|
||||
"verbs": {
|
||||
"name": "verbs",
|
||||
"columns": {
|
||||
"id": {
|
||||
"name": "id",
|
||||
"type": "integer",
|
||||
"primaryKey": true,
|
||||
"notNull": true,
|
||||
"autoincrement": false
|
||||
},
|
||||
"verb": {
|
||||
"name": "verb",
|
||||
"type": "text",
|
||||
"primaryKey": false,
|
||||
"notNull": false,
|
||||
"autoincrement": false,
|
||||
"default": "''"
|
||||
},
|
||||
"translation": {
|
||||
"name": "translation",
|
||||
"type": "text",
|
||||
"primaryKey": false,
|
||||
"notNull": false,
|
||||
"autoincrement": false,
|
||||
"default": "''"
|
||||
},
|
||||
"type": {
|
||||
"name": "type",
|
||||
"type": "text",
|
||||
"primaryKey": false,
|
||||
"notNull": false,
|
||||
"autoincrement": false
|
||||
},
|
||||
"created_at": {
|
||||
"name": "created_at",
|
||||
"type": "text",
|
||||
"primaryKey": false,
|
||||
"notNull": false,
|
||||
"autoincrement": false,
|
||||
"default": "(CURRENT_DATE)"
|
||||
}
|
||||
},
|
||||
"indexes": {},
|
||||
"foreignKeys": {},
|
||||
"compositePrimaryKeys": {},
|
||||
"uniqueConstraints": {}
|
||||
},
|
||||
"words": {
|
||||
"name": "words",
|
||||
"columns": {
|
||||
"id": {
|
||||
"name": "id",
|
||||
"type": "integer",
|
||||
"primaryKey": true,
|
||||
"notNull": true,
|
||||
"autoincrement": false
|
||||
},
|
||||
"word": {
|
||||
"name": "word",
|
||||
"type": "text",
|
||||
"primaryKey": false,
|
||||
"notNull": false,
|
||||
"autoincrement": false,
|
||||
"default": "''"
|
||||
},
|
||||
"translation": {
|
||||
"name": "translation",
|
||||
"type": "text",
|
||||
"primaryKey": false,
|
||||
"notNull": false,
|
||||
"autoincrement": false,
|
||||
"default": "''"
|
||||
},
|
||||
"created_at": {
|
||||
"name": "created_at",
|
||||
"type": "text",
|
||||
"primaryKey": false,
|
||||
"notNull": false,
|
||||
"autoincrement": false,
|
||||
"default": "(CURRENT_DATE)"
|
||||
}
|
||||
},
|
||||
"indexes": {},
|
||||
"foreignKeys": {},
|
||||
"compositePrimaryKeys": {},
|
||||
"uniqueConstraints": {}
|
||||
}
|
||||
},
|
||||
"enums": {},
|
||||
"_meta": {
|
||||
"schemas": {},
|
||||
"tables": {
|
||||
"\"users\"": "\"verbs\""
|
||||
},
|
||||
"columns": {
|
||||
"\"verbs\".\"name\"": "\"verbs\".\"verb\""
|
||||
}
|
||||
},
|
||||
"internal": {
|
||||
"indexes": {}
|
||||
}
|
||||
}
|
||||
@@ -8,6 +8,13 @@
|
||||
"when": 1721758030188,
|
||||
"tag": "0000_hot_thunderball",
|
||||
"breakpoints": true
|
||||
},
|
||||
{
|
||||
"idx": 1,
|
||||
"version": "6",
|
||||
"when": 1721924389034,
|
||||
"tag": "0001_conscious_plazm",
|
||||
"breakpoints": true
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -1,8 +1,17 @@
|
||||
import { integer, sqliteTable, text } from 'drizzle-orm/sqlite-core'
|
||||
import { sql } from 'drizzle-orm'
|
||||
|
||||
export const users = sqliteTable('users', {
|
||||
export const verbs = sqliteTable('verbs', {
|
||||
id: integer('id').primaryKey(),
|
||||
name: text('name').default(''),
|
||||
verb: text('verb').default(''),
|
||||
translation: text('translation').default(''),
|
||||
type: text('type', { enum: ['-ar', '-er', '-ir'] }),
|
||||
createdAt: text('created_at').default(sql`(CURRENT_DATE)`),
|
||||
})
|
||||
|
||||
export const words = sqliteTable('words', {
|
||||
id: integer('id').primaryKey(),
|
||||
word: text('word').default(''),
|
||||
translation: text('translation').default(''),
|
||||
createdAt: text('created_at').default(sql`(CURRENT_DATE)`),
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user