Compare commits
No commits in common. "3621cf6ae2b61a2435516d476c4cb9da529530b7" and "741a509ef6935755d0022b9979a710da4422ca65" have entirely different histories.
3621cf6ae2
...
741a509ef6
5 changed files with 2 additions and 165 deletions
|
|
@ -1,17 +0,0 @@
|
||||||
CREATE TABLE `eventsTable` (
|
|
||||||
`id` integer PRIMARY KEY NOT NULL,
|
|
||||||
`startTime` text NOT NULL,
|
|
||||||
`endTime` text NOT NULL,
|
|
||||||
`name` text NOT NULL,
|
|
||||||
`title` text NOT NULL,
|
|
||||||
`description` text NOT NULL,
|
|
||||||
`type` text NOT NULL,
|
|
||||||
`lineId` integer NOT NULL,
|
|
||||||
FOREIGN KEY (`lineId`) REFERENCES `linesTable`(`id`) ON UPDATE cascade ON DELETE cascade
|
|
||||||
);
|
|
||||||
--> statement-breakpoint
|
|
||||||
CREATE TABLE `linesTable` (
|
|
||||||
`id` integer PRIMARY KEY NOT NULL,
|
|
||||||
`name` text NOT NULL,
|
|
||||||
`description` text NOT NULL
|
|
||||||
);
|
|
||||||
|
|
@ -1,129 +0,0 @@
|
||||||
{
|
|
||||||
"version": "6",
|
|
||||||
"dialect": "sqlite",
|
|
||||||
"id": "67a86f93-2bc8-4fe2-8786-995874bf9863",
|
|
||||||
"prevId": "00000000-0000-0000-0000-000000000000",
|
|
||||||
"tables": {
|
|
||||||
"eventsTable": {
|
|
||||||
"name": "eventsTable",
|
|
||||||
"columns": {
|
|
||||||
"id": {
|
|
||||||
"name": "id",
|
|
||||||
"type": "integer",
|
|
||||||
"primaryKey": true,
|
|
||||||
"notNull": true,
|
|
||||||
"autoincrement": false
|
|
||||||
},
|
|
||||||
"startTime": {
|
|
||||||
"name": "startTime",
|
|
||||||
"type": "text",
|
|
||||||
"primaryKey": false,
|
|
||||||
"notNull": true,
|
|
||||||
"autoincrement": false
|
|
||||||
},
|
|
||||||
"endTime": {
|
|
||||||
"name": "endTime",
|
|
||||||
"type": "text",
|
|
||||||
"primaryKey": false,
|
|
||||||
"notNull": true,
|
|
||||||
"autoincrement": false
|
|
||||||
},
|
|
||||||
"name": {
|
|
||||||
"name": "name",
|
|
||||||
"type": "text",
|
|
||||||
"primaryKey": false,
|
|
||||||
"notNull": true,
|
|
||||||
"autoincrement": false
|
|
||||||
},
|
|
||||||
"title": {
|
|
||||||
"name": "title",
|
|
||||||
"type": "text",
|
|
||||||
"primaryKey": false,
|
|
||||||
"notNull": true,
|
|
||||||
"autoincrement": false
|
|
||||||
},
|
|
||||||
"description": {
|
|
||||||
"name": "description",
|
|
||||||
"type": "text",
|
|
||||||
"primaryKey": false,
|
|
||||||
"notNull": true,
|
|
||||||
"autoincrement": false
|
|
||||||
},
|
|
||||||
"type": {
|
|
||||||
"name": "type",
|
|
||||||
"type": "text",
|
|
||||||
"primaryKey": false,
|
|
||||||
"notNull": true,
|
|
||||||
"autoincrement": false
|
|
||||||
},
|
|
||||||
"lineId": {
|
|
||||||
"name": "lineId",
|
|
||||||
"type": "integer",
|
|
||||||
"primaryKey": false,
|
|
||||||
"notNull": true,
|
|
||||||
"autoincrement": false
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"indexes": {},
|
|
||||||
"foreignKeys": {
|
|
||||||
"eventsTable_lineId_linesTable_id_fk": {
|
|
||||||
"name": "eventsTable_lineId_linesTable_id_fk",
|
|
||||||
"tableFrom": "eventsTable",
|
|
||||||
"tableTo": "linesTable",
|
|
||||||
"columnsFrom": [
|
|
||||||
"lineId"
|
|
||||||
],
|
|
||||||
"columnsTo": [
|
|
||||||
"id"
|
|
||||||
],
|
|
||||||
"onDelete": "cascade",
|
|
||||||
"onUpdate": "cascade"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"compositePrimaryKeys": {},
|
|
||||||
"uniqueConstraints": {},
|
|
||||||
"checkConstraints": {}
|
|
||||||
},
|
|
||||||
"linesTable": {
|
|
||||||
"name": "linesTable",
|
|
||||||
"columns": {
|
|
||||||
"id": {
|
|
||||||
"name": "id",
|
|
||||||
"type": "integer",
|
|
||||||
"primaryKey": true,
|
|
||||||
"notNull": true,
|
|
||||||
"autoincrement": false
|
|
||||||
},
|
|
||||||
"name": {
|
|
||||||
"name": "name",
|
|
||||||
"type": "text",
|
|
||||||
"primaryKey": false,
|
|
||||||
"notNull": true,
|
|
||||||
"autoincrement": false
|
|
||||||
},
|
|
||||||
"description": {
|
|
||||||
"name": "description",
|
|
||||||
"type": "text",
|
|
||||||
"primaryKey": false,
|
|
||||||
"notNull": true,
|
|
||||||
"autoincrement": false
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"indexes": {},
|
|
||||||
"foreignKeys": {},
|
|
||||||
"compositePrimaryKeys": {},
|
|
||||||
"uniqueConstraints": {},
|
|
||||||
"checkConstraints": {}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"views": {},
|
|
||||||
"enums": {},
|
|
||||||
"_meta": {
|
|
||||||
"schemas": {},
|
|
||||||
"tables": {},
|
|
||||||
"columns": {}
|
|
||||||
},
|
|
||||||
"internal": {
|
|
||||||
"indexes": {}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -1,13 +0,0 @@
|
||||||
{
|
|
||||||
"version": "7",
|
|
||||||
"dialect": "sqlite",
|
|
||||||
"entries": [
|
|
||||||
{
|
|
||||||
"idx": 0,
|
|
||||||
"version": "6",
|
|
||||||
"when": 1750781935205,
|
|
||||||
"tag": "0000_low_firebird",
|
|
||||||
"breakpoints": true
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
|
|
@ -10,8 +10,8 @@ export default async function FavoritesPage() {
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="flex flex-col items-center justify-items-center p-8 pb-20 gap-4 sm:p-20 w-full">
|
<div className="flex flex-col items-center justify-items-center p-8 pb-20 gap-4 sm:p-20 w-full">
|
||||||
<h1 className="text-3xl font-bold mb-4 w-full">Oblíbené</h1>
|
<h1 className="text-3xl font-bold mb-4">Oblíbené</h1>
|
||||||
<main className="flex flex-col gap-8 w-full">
|
<main className="flex flex-col gap-8 items-center">
|
||||||
<EventList events={favorites} showDate showLine />
|
<EventList events={favorites} showDate showLine />
|
||||||
</main>
|
</main>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,6 @@ import type { Event, Line } from "@/common/parser";
|
||||||
import "dotenv/config";
|
import "dotenv/config";
|
||||||
import { and, eq, gte, inArray, like, lte, or } from "drizzle-orm";
|
import { and, eq, gte, inArray, like, lte, or } from "drizzle-orm";
|
||||||
import { drizzle } from "drizzle-orm/libsql";
|
import { drizzle } from "drizzle-orm/libsql";
|
||||||
import { migrate } from "drizzle-orm/libsql/migrator";
|
|
||||||
import {
|
import {
|
||||||
eventsTable,
|
eventsTable,
|
||||||
type eventsTableSelectSchema,
|
type eventsTableSelectSchema,
|
||||||
|
|
@ -14,9 +13,6 @@ if (!process.env.DB_FILE_NAME) {
|
||||||
}
|
}
|
||||||
|
|
||||||
const db = drizzle(process.env.DB_FILE_NAME);
|
const db = drizzle(process.env.DB_FILE_NAME);
|
||||||
await migrate(db, {
|
|
||||||
migrationsFolder: "./drizzle",
|
|
||||||
});
|
|
||||||
|
|
||||||
export async function saveLines(lines: Line[]) {
|
export async function saveLines(lines: Line[]) {
|
||||||
await db
|
await db
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue