
CREATE DATABASE IF NOT EXISTS espacecolis;
USE espacecolis;

CREATE TABLE IF NOT EXISTS users (
    id INT AUTO_INCREMENT PRIMARY KEY,
    name VARCHAR(100),
    email VARCHAR(100) UNIQUE,
    password VARCHAR(255),
    role ENUM('admin', 'client') DEFAULT 'client'
);

CREATE TABLE IF NOT EXISTS parcels (
    id INT AUTO_INCREMENT PRIMARY KEY,
    user_id INT,
    description TEXT,
    tracking_code VARCHAR(100) UNIQUE,
    status VARCHAR(100),
    FOREIGN KEY (user_id) REFERENCES users(id)
);
