feat: link uuid + increase counter concurrently

This commit is contained in:
Juan Rodriguez
2024-05-13 08:08:20 +02:00
parent b34a52f3e0
commit e4ae0c2ac4
5 changed files with 38 additions and 6 deletions
@@ -1,10 +1,10 @@
-- +micrate Up
-- SQL in section 'Up' is executed when this migration is applied
CREATE TABLE links (
id INTEGER PRIMARY KEY AUTOINCREMENT,
id TEXT PRIMARY KEY NOT NULL,
slug VARCHAR(100) UNIQUE NOT NULL,
url TEXT NOT NULL,
click_counter INTEGER DEFAULT 0,
click_counter INTEGER NOT NULL DEFAULT 0,
created_at INTEGER DEFAULT CURRENT_TIMESTAMP NOT NULL,
updated_at INTEGER DEFAULT CURRENT_TIMESTAMP NOT NULL
);