-- +migrate Up

CREATE TABLE `campaigns` (
    `id`            BIGINT PRIMARY KEY AUTO_INCREMENT,
    `title`         VARCHAR(255) NOT NULL,
    `description`   TEXT,
    `goal_amount`   DECIMAL(15,2) NOT NULL,
    `raised_amount` DECIMAL(15,2) DEFAULT 0,
    `status`        VARCHAR(50) NOT NULL,
    `created_at`    TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
    `deadline_at`   TIMESTAMP,
    `admin_id`      BIGINT NOT NULL,
    FOREIGN KEY (`admin_id`) REFERENCES `users`(`id`) ON DELETE RESTRICT
);


-- +migrate Down
DROP TABLE `campaigns`;
