CREATE DATABASE aldirBlanc;
USE aldirBlanc;

CREATE TABLE posts(
    id int PRIMARY KEY AUTO_INCREMENT NOT NULL,
    title varchar(255) NOT NULL,
    author varchar(255) NOT NULL,
    videoID varchar(255),
    category varchar(255),
    date varchar(10) NOT NULL,
    content text NOT NULL,
    isActive TINYINT NOT NULL DEFAULT 1
);

CREATE TABLE users (
  id int NOT NULL PRIMARY KEY AUTO_INCREMENT,
  username varchar(50) UNIQUE NOT NULL,
  password varchar(255) NOT NULL,
  created_at datetime DEFAULT CURRENT_TIMESTAMP
);

INSERT INTO users (id, username, password) VALUES
(1, 'admin', '$2y$10$WUyE8JA317EhDjpjtcXOCegaTzup/zuIVNm3/c2LY7YOZVb8X9x/a');