Skip to content
This repository was archived by the owner on Oct 20, 2023. It is now read-only.

Commit 02795ff

Browse files
jmrodriguez-clvrobzienert
jmrodriguez-clv
authored andcommitted
feat(cron): Make database-mysql.sql idempotent (spinnaker#614)
This makes the script idempotent, ideally to be run upon echo instance start to populate schema without having to check if the schema and users are already created.
1 parent fbf1be4 commit 02795ff

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed
+3-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
SET tx_isolation = 'READ-COMMITTED';
22

3-
CREATE SCHEMA `echo` DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
4-
CREATE USER echo_migrate;
5-
CREATE USER echo_service;
3+
CREATE SCHEMA IF NOT EXISTS `echo` DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
4+
CREATE USER IF NOT EXISTS echo_migrate;
5+
CREATE USER IF NOT EXISTS echo_service;
66

77
GRANT SELECT, INSERT, UPDATE, DELETE, EXECUTE, SHOW VIEW ON `echo`.* TO 'echo_service'@'%';
88
GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, REFERENCES, INDEX, ALTER, LOCK TABLES, EXECUTE, SHOW VIEW ON `echo`.* TO 'echo_migrate'@'%';

0 commit comments

Comments
 (0)