-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathecc_db.sql
More file actions
173 lines (135 loc) · 4.54 KB
/
ecc_db.sql
File metadata and controls
173 lines (135 loc) · 4.54 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
-- phpMyAdmin SQL Dump
-- version 5.2.1
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Oct 20, 2025 at 10:15 AM
-- Server version: 10.4.32-MariaDB
-- PHP Version: 8.2.12
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8mb4 */;
--
-- Database: `ecc_db`
--
-- --------------------------------------------------------
--
-- Table structure for table `admins`
--
CREATE TABLE `admins` (
`id` int(11) NOT NULL,
`username` varchar(100) NOT NULL,
`password` varchar(255) NOT NULL,
`created_at` timestamp NOT NULL DEFAULT current_timestamp(),
`role` enum('admin','user') NOT NULL DEFAULT 'user'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
--
-- Dumping data for table `admins`
--
INSERT INTO `admins` (`id`, `username`, `password`, `created_at`, `role`) VALUES
(1, 'admin', '$2y$10$8CdENyRLw9UDY5Dl9scTv.Yssg3yaMdmf.mpp1r6L/oEO67hbPrYy', '2025-09-27 06:38:12', 'admin');
-- --------------------------------------------------------
--
-- Table structure for table `carousel`
--
CREATE TABLE `carousel` (
`id` int(11) NOT NULL,
`title` varchar(255) NOT NULL,
`image` varchar(255) NOT NULL,
`status` enum('active','inactive') DEFAULT 'active',
`created_at` timestamp NOT NULL DEFAULT current_timestamp(),
`link` varchar(255) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
--
-- Dumping data for table `carousel`
--
INSERT INTO `carousel` (`id`, `title`, `image`, `status`, `created_at`, `link`) VALUES
(1, 'Sample', 'backend/uploads/carousel/1758976825_man-working-table.jpg', 'active', '2025-09-27 12:40:25', NULL),
(2, 'Sample with link', 'backend/uploads/carousel/1758976865_hands-unrecognizable-man-sitting-table-with-laptop-drawing-diagram-notebook.jpg', 'active', '2025-09-27 12:41:05', 'https://google.com');
-- --------------------------------------------------------
--
-- Table structure for table `news`
--
CREATE TABLE `news` (
`id` int(11) NOT NULL,
`title` varchar(255) NOT NULL,
`image` varchar(255) DEFAULT NULL,
`created_at` timestamp NOT NULL DEFAULT current_timestamp(),
`link` varchar(255) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
--
-- Dumping data for table `news`
--
INSERT INTO `news` (`id`, `title`, `image`, `created_at`, `link`) VALUES
(1, 'Sample', 'backend/uploads/news/1758976924_man-working-table.jpg', '2025-09-27 12:42:04', NULL),
(2, 'Sample with link', 'backend/uploads/news/1758976942_startup-leader-drawing-flowchart-board-discussing-project.jpg', '2025-09-27 12:42:22', 'https://google.com');
--
-- Indexes for dumped tables
--
--
-- Indexes for table `admins`
--
ALTER TABLE `admins`
ADD PRIMARY KEY (`id`),
ADD UNIQUE KEY `username` (`username`);
--
-- Indexes for table `carousel`
--
ALTER TABLE `carousel`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `news`
--
ALTER TABLE `news`
ADD PRIMARY KEY (`id`);
--
-- AUTO_INCREMENT for dumped tables
--
--
-- AUTO_INCREMENT for table `admins`
--
ALTER TABLE `admins`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;
--
-- AUTO_INCREMENT for table `carousel`
--
ALTER TABLE `carousel`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;
--
-- AUTO_INCREMENT for table `news`
--
ALTER TABLE `news`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;
COMMIT;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
--
-- Table structure for table `faq`
--
CREATE TABLE `faq` (
`id` int(11) NOT NULL,
`question` text NOT NULL,
`answer` text NOT NULL,
`created_at` timestamp NOT NULL DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
--
-- Indexes for table `faq`
--
ALTER TABLE `faq`
ADD PRIMARY KEY (`id`);
--
-- AUTO_INCREMENT for table `faq`
--
ALTER TABLE `faq`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;
-- Migration to update status fields
ALTER TABLE carousel MODIFY COLUMN status VARCHAR(20);
UPDATE carousel SET status = 'posted' WHERE status = 'active';
UPDATE carousel SET status = 'draft' WHERE status = 'inactive';
ALTER TABLE news ADD COLUMN status ENUM('draft', 'posted') DEFAULT 'draft';
ALTER TABLE faq ADD COLUMN status ENUM('draft', 'posted') DEFAULT 'draft';