Added functions for adding, deleting and showing tickets
As said, functions got implemented. Also minor changes to migration layout and dependencies
This commit is contained in:
2
migrations/20260422094704_types.down.sql
Normal file
2
migrations/20260422094704_types.down.sql
Normal file
@@ -0,0 +1,2 @@
|
||||
DROP TYPE category;
|
||||
DROP TYPE status;
|
||||
2
migrations/20260422094704_types.up.sql
Normal file
2
migrations/20260422094704_types.up.sql
Normal file
@@ -0,0 +1,2 @@
|
||||
CREATE TYPE category AS ENUM('Whiteboard Beamer', 'Internet', 'iPad Koffer', 'Apple TV', 'Docu Cam', 'Sonstiges');
|
||||
CREATE TYPE status AS ENUM('ToDo', 'InProgress', 'Done', 'Archived');
|
||||
2
migrations/20260422094706_ticket_table.down.sql
Normal file
2
migrations/20260422094706_ticket_table.down.sql
Normal file
@@ -0,0 +1,2 @@
|
||||
DROP TABLE tickets;
|
||||
|
||||
@@ -1,12 +1,10 @@
|
||||
CREATE TYPE category AS ENUM('Whiteboard Beamer', 'Internet', 'iPad Koffer', 'Apple TV', 'Docu Cam', 'Sonstiges')
|
||||
CREAYE TYPE status AS ENUM('ToDo', 'InProgress', 'Done', 'Archived')
|
||||
CREATE TABLE IF NOT EXISTS tickets (
|
||||
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
||||
id INTEGER GENERATED ALWAYS AS IDENTITY PRIMARY KEY,
|
||||
category category NOT NULL DEFAULT 'Sonstiges',
|
||||
betreff VARCHAR(100),
|
||||
description VARCHAR,
|
||||
description TEXT,
|
||||
room SMALLINT,
|
||||
status status NOT NULL DEFAULT 'ToDo',
|
||||
date TIMESTAMP,
|
||||
date TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
|
||||
user_id SMALLINT
|
||||
);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
CREATE TABLE users (
|
||||
id SMALLINT PRIMARY KEY AUTOINCREMENT,
|
||||
id SMALLINT GENERATED ALWAYS AS IDENTITY PRIMARY KEY,
|
||||
name VARCHAR(30),
|
||||
firstname VARCHAR(30),
|
||||
is_admin BOOLEAN NOT NULL DEFAULT false
|
||||
|
||||
Reference in New Issue
Block a user