-
-
Save parzibyte/4ebd36a9b5c44481d0f539aba9f2ea09 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CREATE TABLE IF NOT EXISTS users( | |
id BIGINT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY, | |
email varchar(255) NOT NULL UNIQUE, | |
password varchar(255) NOT NULL | |
); | |
CREATE TABLE IF NOT EXISTS links( | |
id BIGINT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY, | |
hash varchar(6) UNIQUE, | |
title varchar(255) NOT NULL, | |
real_link varchar(1024) NOT NULL, | |
instant_redirect BOOLEAN DEFAULT 1 | |
); | |
CREATE TABLE IF NOT EXISTS statistics( | |
link_id BIGINT UNSIGNED NOT NULL, | |
date varchar(10) NOT NULL, | |
FOREIGN KEY (link_id) REFERENCES links(id) ON DELETE CASCADE ON UPDATE CASCADE | |
); | |
# A default user. Password is 'hunter2' | |
INSERT INTO `users` (`email`, `password`) VALUES | |
('parzibyte@gmail.com', '$2y$10$DVMlG/zp8rB3KrW6oRvpvOgbIkoRRfOXu/9H5DgTfVQXwZP5m.tQy'); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment