Init project

This commit is contained in:
2024-07-25 23:44:32 +02:00
parent 426cbe8777
commit 5092005816
11 changed files with 144 additions and 434 deletions

View 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;

View 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": {}
}
}

View File

@@ -8,6 +8,13 @@
"when": 1721758030188,
"tag": "0000_hot_thunderball",
"breakpoints": true
},
{
"idx": 1,
"version": "6",
"when": 1721924389034,
"tag": "0001_conscious_plazm",
"breakpoints": true
}
]
}
}

View File

@@ -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)`),
})