forked from kamba4/sunders
added querry to check if the state sequenceNumber is already present
This commit is contained in:
parent
985fbf7600
commit
d9897c57eb
1 changed files with 7 additions and 0 deletions
|
@ -68,7 +68,14 @@ CREATE TABLE IF NOT EXISTS sync_state (
|
||||||
v VARCHAR(100)
|
v VARCHAR(100)
|
||||||
)
|
)
|
||||||
");
|
");
|
||||||
|
|
||||||
|
$result = $conn -> query("SELECT * FROM sync_state WHERE k='sequenceNumber'");
|
||||||
|
|
||||||
|
$table_count = $result -> num_rows;
|
||||||
|
|
||||||
|
if ($table_count == 0){
|
||||||
$conn->query("INSERT INTO sync_state (k, v) VALUES ('sequenceNumber', '0');");
|
$conn->query("INSERT INTO sync_state (k, v) VALUES ('sequenceNumber', '0');");
|
||||||
|
}
|
||||||
|
|
||||||
echo "Database, users, and tables created successfully.\n";
|
echo "Database, users, and tables created successfully.\n";
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue