diff --git a/Containerfile.utils b/Containerfile.utils index e9f4bba..763c449 100644 --- a/Containerfile.utils +++ b/Containerfile.utils @@ -2,4 +2,3 @@ FROM docker.io/library/php:cli RUN docker-php-ext-install mysqli bcmath COPY ./utils/* /opt/ -COPY ./data_init/*.sql /opt/init/init.sql diff --git a/create_db.sh b/create_db.sh deleted file mode 100644 index 9a27b62..0000000 --- a/create_db.sh +++ /dev/null @@ -1,2 +0,0 @@ -podman run --network tor -it --env MYSQL_USER=root --env MYSQL_PASSWD=my-secret-pw --env MYSQL_DATABASE=exmple-database --env MARIADB_ROOT_PASSWORD=my-secret-pw -e MYSQL_HOST=some-mariadb -e MYSQL_DB=sunders -e CAMERA_USER=cam -e CAMERA_USER_PASSWD=asdf1234 -e CAMERA_SELECT_USER=cam -e CAMERA_SELECT_USER_PASSWD=asdf1234 localhost/sunders-utils:latest php /opt/create_db.php -podman run --network tor -it --env MYSQL_USER=root --env MYSQL_PASSWD=my-secret-pw --env MYSQL_DATABASE=exmple-database --env MARIADB_ROOT_PASSWORD=my-secret-pw -e MYSQL_HOST=some-mariadb -e MYSQL_DB=sunders -e CAMERA_USER=cam -e CAMERA_USER_PASSWD=asdf1234 -e CAMERA_SELECT_USER=cam -e CAMERA_SELECT_USER_PASSWD=asdf1234 localhost/sunders-data_init:latest \ No newline at end of file diff --git a/utils/init_db.php b/utils/create_db.php similarity index 86% rename from utils/init_db.php rename to utils/create_db.php index 90d6978..9643699 100644 --- a/utils/init_db.php +++ b/utils/create_db.php @@ -72,19 +72,5 @@ $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(); ?>