update schema
This commit is contained in:
parent
aabdb7b681
commit
21027ba93c
@ -1,3 +1,5 @@
|
||||
SET FOREIGN_KEY_CHECKS=0;
|
||||
|
||||
-- Table structure for `branches`
|
||||
CREATE TABLE IF NOT EXISTS `branches` (
|
||||
`id` int(11) NOT NULL AUTO_INCREMENT,
|
||||
@ -236,3 +238,6 @@ INSERT IGNORE INTO `users` (`id`, `username`, `password`, `role`, `permissions`,
|
||||
INSERT IGNORE INTO `users` (`id`, `username`, `password`, `role`, `permissions`, `branch_code`, `allowed_branches`, `name_ar`, `name_en`, `created_at`) VALUES ('2', 'manager_muscat', '$2y$10$mXI290vI7qEIP.At1YFeFOt/pHf096S3h7CWHYfJYluw7QQlM7uDm', 'manager', NULL, 'muscat', NULL, 'مدير فرع مسقط', 'Muscat Branch Manager', '2026-04-19 09:23:45');
|
||||
INSERT IGNORE INTO `users` (`id`, `username`, `password`, `role`, `permissions`, `branch_code`, `allowed_branches`, `name_ar`, `name_en`, `created_at`) VALUES ('3', 'cashier_sohar', '$2y$10$.iWxSZWkRuWhuNrmt/LAv./HCWlHQJSpoYqa9pJMoobHCWbMpvXZe', 'cashier', NULL, 'sohar', NULL, 'كاشير فرع صحار', 'Sohar Cashier', '2026-04-19 09:23:46');
|
||||
|
||||
|
||||
SET FOREIGN_KEY_CHECKS=1;
|
||||
|
||||
|
||||
@ -4,11 +4,13 @@ $pdo = db();
|
||||
$stmt = $pdo->query("SHOW TABLES");
|
||||
$tables = $stmt->fetchAll(PDO::FETCH_COLUMN);
|
||||
|
||||
$sql = "";
|
||||
$sql = "SET FOREIGN_KEY_CHECKS=0;
|
||||
|
||||
";
|
||||
foreach ($tables as $table) {
|
||||
$createStmt = $pdo->query("SHOW CREATE TABLE `$table`")->fetch(PDO::FETCH_ASSOC);
|
||||
$sql .= "-- Table structure for `$table`\n";
|
||||
$sql .= $createStmt['Create Table'] . ";\n\n";
|
||||
}
|
||||
echo $sql;
|
||||
|
||||
$sql .= "SET FOREIGN_KEY_CHECKS=1;\n";
|
||||
echo $sql;
|
||||
Loading…
x
Reference in New Issue
Block a user