diff --git a/db/migrations/002_create_plans_table.sql b/db/migrations/002_create_plans_table.sql index 70d1920..6a551f9 100644 --- a/db/migrations/002_create_plans_table.sql +++ b/db/migrations/002_create_plans_table.sql @@ -1,18 +1,10 @@ -- Create the plans table CREATE TABLE IF NOT EXISTS `plans` ( `id` INT AUTO_INCREMENT PRIMARY KEY, - `name` VARCHAR(255) NOT NULL, - `speed` VARCHAR(100) NOT NULL, -- e.g., '25/10 Mbps' - `price` DECIMAL(10, 2) NOT NULL, + `name` VARCHAR(255) NOT NULL UNIQUE, + `speed_mbps` INT NOT NULL, + `price_monthly` DECIMAL(10, 2) NOT NULL, + `contract_months` INT NOT NULL, `description` TEXT, - `is_active` BOOLEAN NOT NULL DEFAULT TRUE, - `contract_months` INT NOT NULL DEFAULT 1, -- e.g., 1 for month-to-month, 12 for a year - `created_at` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; - --- Insert the initial plans from the landing page -INSERT INTO `plans` (`name`, `speed`, `price`, `description`, `contract_months`) VALUES -('Basic', '25/10 Mbps', 59.00, 'Ideal for browsing and streaming.', 1), -('Standard', '50/20 Mbps', 69.00, 'Perfect for HD streaming and gaming.', 1), -('Premium', '100/40 Mbps', 89.00, 'For heavy usage and multiple devices.', 12), -('Ultimate', '1000/50 Mbps', 129.00, 'Ultimate speed for professionals.', 12); + `created_at` TIMESTAMP DEFAULT CURRENT_TIMESTAMP +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; \ No newline at end of file diff --git a/db/migrations/007_seed_sample_data.sql b/db/migrations/007_seed_sample_data.sql index 2304f4b..afa8cc0 100644 --- a/db/migrations/007_seed_sample_data.sql +++ b/db/migrations/007_seed_sample_data.sql @@ -1,4 +1,12 @@ -- Seed the pages table with an "About Us" and "Terms of Service" page INSERT INTO `pages` (`title`, `slug`, `content`) VALUES ('About Us', 'about-us', '

About Us

We are a leading provider of telecommunication services, committed to connecting you to the world. This page was generated by the CMS.

'), -('Terms of Service', 'terms-of-service', '

Terms of Service

By using our services, you agree to our terms. This is a sample page.

'); \ No newline at end of file +('Terms of Service', 'terms-of-service', '

Terms of Service

By using our services, you agree to our terms. This is a sample page.

'), +('Privacy Policy', 'privacy-policy', '

Privacy Policy

Your privacy is important to us. This is a sample page.

'); + +-- Let's add some sample plans to make the landing page look populated. +INSERT INTO `plans` (`name`, `speed_mbps`, `price_monthly`, `contract_months`, `description`) VALUES +('Basic Connect', 25, 49.99, 12, 'Ideal for browsing and email.'), +('Family Streamer', 50, 69.99, 12, 'Perfect for streaming HD video on multiple devices.'), +('Super Fast Gamer', 100, 89.99, 24, 'Low latency for the ultimate gaming experience.'), +('Power User', 250, 109.99, 24, 'For heavy-duty usage, 4K streaming, and large downloads.');