ADD Clip Table

This commit is contained in:
2025-06-13 10:35:52 +02:00
parent fa120fe7b5
commit 0986552059
5 changed files with 95 additions and 2 deletions

View File

@@ -1,9 +1,28 @@
DROP TABLE IF EXISTS clips;
DROP TABLE IF EXISTS users;
CREATE TABLE IF NOT EXISTS users (
id BIGINT PRIMARY KEY,
google_id VARCHAR(64),
username VARCHAR(50) NOT NULL UNIQUE,
email VARCHAR(100) NOT NULL UNIQUE,
name VARCHAR(100) NOT NULL,
role INTEGER DEFAULT 0,
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);
CREATE TABLE IF NOT EXISTS clips (
id BIGINT PRIMARY KEY,
user_id BIGINT NOT NULL,
title VARCHAR(255) NOT NULL,
description TEXT,
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
width INTEGER NOT NULL,
height INTEGER NOT NULL,
fps INTEGER NOT NULL,
duration INTEGER NOT NULL,
file_size BIGINT NOT NULL,
video_path VARCHAR(255) NOT NULL,
FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE
);