moved init to utils container

This commit is contained in:
asohh 2025-10-11 21:52:41 +02:00
commit 985fbf7600
3 changed files with 17 additions and 0 deletions

View file

@ -72,5 +72,19 @@ $conn->query("INSERT INTO sync_state (k, v) VALUES ('sequenceNumber', '0');");
echo "Database, users, and tables created successfully.\n";
$result = $conn -> query("SELECT * FROM position limit 10");
$table_count = $result -> num_rows;
printf("Result set has %d rows.\n", $table_count);
if ($table_count == 0){
$location = "/opt/init/init.sql";
$commands = file_get_contents($location);
$conn->multi_query($commands);
echo "Inserted data.\n";
}
$conn->close();
?>