feat: create links - route + controller + model + migration

This commit is contained in:
Juan Rodriguez
2024-05-12 22:50:47 +02:00
parent 3e86e761b6
commit c806953b9a
13 changed files with 132 additions and 11 deletions
@@ -0,0 +1,14 @@
-- +micrate Up
-- SQL in section 'Up' is executed when this migration is applied
CREATE TABLE links (
id INTEGER PRIMARY KEY AUTOINCREMENT,
slug VARCHAR(100) UNIQUE NOT NULL,
url TEXT NOT NULL,
click_counter INTEGER DEFAULT 0,
created_at INTEGER DEFAULT CURRENT_TIMESTAMP NOT NULL,
updated_at INTEGER DEFAULT CURRENT_TIMESTAMP NOT NULL
);
-- +micrate Down
-- SQL section 'Down' is executed when this migration is rolled back
DROP TABLE links;