github.com/oinume/lekcije@v0.0.0-20231017100347-5b4c5eb6ab24/backend/db/migrations/20161016050000_plan.sql (about)

     1  -- +goose Up
     2  -- SQL in section 'Up' is executed when this migration is applied
     3  CREATE TABLE IF NOT EXISTS plan (
     4    `id` tinyint unsigned NOT NULL,
     5    `name` varchar(255) NOT NULL,
     6    `internal_name` varchar(255) NOT NULL,
     7    `price` mediumint NOT NULL,
     8    `notification_interval` tinyint unsigned NOT NULL,
     9    `show_ad` tinyint(1) unsigned NOT NULL,
    10    `created_at` datetime NOT NULL,
    11    `updated_at` datetime NOT NULL,
    12    PRIMARY KEY (`id`)
    13  ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin ROW_FORMAT=DYNAMIC;
    14  
    15  INSERT INTO plan VALUES (1, 'Free', 'Free', 0, 20, 1, '2016-10-16 00:00:00', '2016-10-16 00:00:00');
    16  INSERT INTO plan VALUES (2, 'Standard', 'Standard', 300, 10, 0, '2016-10-16 00:00:00', '2016-10-16 00:00:00');
    17  INSERT INTO plan VALUES (3, 'Plus', 'Plus', 500, 5, 0, '2016-10-16 00:00:00', '2016-10-16 00:00:00');
    18  
    19  ALTER TABLE user ADD COLUMN `plan_id` tinyint unsigned NOT NULL DEFAULT 1 AFTER `email_verified`;
    20  
    21  -- +goose Down
    22  -- SQL section 'Down' is executed when this migration is rolled back
    23  DROP TABLE IF EXISTS plan;
    24  ALTER TABLE user DROP COLUMN `plan_id`;