Autosave: 20260305-001118
This commit is contained in:
parent
92b11ad0f7
commit
68b13ff62d
32
db/migrate_celestial_object_types.php
Normal file
32
db/migrate_celestial_object_types.php
Normal file
@ -0,0 +1,32 @@
|
|||||||
|
<?php
|
||||||
|
require_once __DIR__ . '/config.php';
|
||||||
|
|
||||||
|
function migrate_celestial_object_types() {
|
||||||
|
$db = db();
|
||||||
|
|
||||||
|
// Check if table exists
|
||||||
|
$result = $db->query("SHOW TABLES LIKE 'celestial_object_types'");
|
||||||
|
if ($result->rowCount() > 0) {
|
||||||
|
echo "Table celestial_object_types already exists.\n";
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
echo "Creating table celestial_object_types...\n";
|
||||||
|
$sql = "CREATE TABLE celestial_object_types (
|
||||||
|
id INT AUTO_INCREMENT PRIMARY KEY,
|
||||||
|
name VARCHAR(255) NOT NULL,
|
||||||
|
slug VARCHAR(50) NOT NULL UNIQUE,
|
||||||
|
icon VARCHAR(50),
|
||||||
|
description TEXT,
|
||||||
|
image_url VARCHAR(255),
|
||||||
|
orbital_control_enabled TINYINT(1) DEFAULT 1,
|
||||||
|
terrestrial_control_enabled TINYINT(1) DEFAULT 1,
|
||||||
|
status_profile_id INT
|
||||||
|
) ENGINE=InnoDB;";
|
||||||
|
|
||||||
|
$db->exec($sql);
|
||||||
|
echo "Table celestial_object_types created successfully.\n";
|
||||||
|
}
|
||||||
|
|
||||||
|
migrate_celestial_object_types();
|
||||||
|
?>
|
||||||
17
db/migrate_planets_table.php
Normal file
17
db/migrate_planets_table.php
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
<?php
|
||||||
|
require_once __DIR__ . '/config.php';
|
||||||
|
$db = db();
|
||||||
|
$sql = "CREATE TABLE IF NOT EXISTS planets (
|
||||||
|
id INT AUTO_INCREMENT PRIMARY KEY,
|
||||||
|
galaxy_id INT,
|
||||||
|
sector_id INT,
|
||||||
|
slot INT,
|
||||||
|
name VARCHAR(255),
|
||||||
|
type VARCHAR(255),
|
||||||
|
status VARCHAR(255),
|
||||||
|
faction_id INT,
|
||||||
|
orbital_control INT,
|
||||||
|
terrestrial_control INT
|
||||||
|
);";
|
||||||
|
$db->exec($sql);
|
||||||
|
echo "Table 'planets' checked/created.";
|
||||||
14
db/migrate_sectors_table.php
Normal file
14
db/migrate_sectors_table.php
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
<?php
|
||||||
|
require_once __DIR__ . '/config.php';
|
||||||
|
|
||||||
|
$db = db();
|
||||||
|
$sql = "CREATE TABLE IF NOT EXISTS sectors (
|
||||||
|
id INT(11) NOT NULL,
|
||||||
|
galaxy_id INT(11) DEFAULT NULL,
|
||||||
|
name VARCHAR(255) DEFAULT NULL,
|
||||||
|
status VARCHAR(50) DEFAULT 'unexplored',
|
||||||
|
PRIMARY KEY (id)
|
||||||
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;";
|
||||||
|
|
||||||
|
$db->exec($sql);
|
||||||
|
echo "Table 'sectors' created successfully.\n";
|
||||||
5
error.log
Normal file
5
error.log
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
PHP Fatal error: Uncaught PDOException: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'app_38676.celestial_object_statuses' doesn't exist in /home/ubuntu/executor/workspace/index.php:21
|
||||||
|
Stack trace:
|
||||||
|
#0 /home/ubuntu/executor/workspace/index.php(21): PDO->query()
|
||||||
|
#1 {main}
|
||||||
|
thrown in /home/ubuntu/executor/workspace/index.php on line 21
|
||||||
Loading…
x
Reference in New Issue
Block a user