Skip to content

Commit

Permalink
Merge pull request #36914 from yrodiere/safer-test-init
Browse files Browse the repository at this point in the history
Reset databases/users for each Hibernate ORM tenancy test module
  • Loading branch information
gsmet authored Nov 7, 2023
2 parents 0a27cad + a32fed6 commit 41745fd
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 23 deletions.
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
CREATE DATABASE IF NOT EXISTS base;
CREATE DATABASE IF NOT EXISTS mycompany;
CREATE DATABASE IF NOT EXISTS inventory;
CREATE DATABASE IF NOT EXISTS inventorymycompany;
CREATE OR REPLACE DATABASE base;
CREATE OR REPLACE DATABASE mycompany;
CREATE OR REPLACE DATABASE inventory;
CREATE OR REPLACE DATABASE inventorymycompany;

CREATE USER IF NOT EXISTS 'jane'@'%' IDENTIFIED BY 'abc';
CREATE OR REPLACE USER 'jane'@'%' IDENTIFIED BY 'abc';
GRANT ALL privileges ON base.* TO 'jane'@'%';
GRANT ALL privileges ON mycompany.* TO 'jane'@'%';

CREATE USER IF NOT EXISTS 'john'@'%' IDENTIFIED BY 'def';
CREATE OR REPLACE USER 'john'@'%' IDENTIFIED BY 'def';
GRANT ALL privileges ON inventory.* TO 'john'@'%';
GRANT ALL privileges ON inventorymycompany.* TO 'john'@'%';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
CREATE DATABASE IF NOT EXISTS base;
CREATE DATABASE IF NOT EXISTS mycompany;
CREATE DATABASE IF NOT EXISTS inventory;
CREATE DATABASE IF NOT EXISTS inventorymycompany;
CREATE OR REPLACE DATABASE base;
CREATE OR REPLACE DATABASE mycompany;
CREATE OR REPLACE DATABASE inventory;
CREATE OR REPLACE DATABASE inventorymycompany;

CREATE USER IF NOT EXISTS 'jane'@'%' IDENTIFIED BY 'abc';
CREATE OR REPLACE USER 'jane'@'%' IDENTIFIED BY 'abc';
GRANT ALL privileges ON base.* TO 'jane'@'%';
GRANT ALL privileges ON mycompany.* TO 'jane'@'%';

CREATE USER IF NOT EXISTS 'john'@'%' IDENTIFIED BY 'def';
CREATE OR REPLACE USER 'john'@'%' IDENTIFIED BY 'def';
GRANT ALL privileges ON inventory.* TO 'john'@'%';
GRANT ALL privileges ON inventorymycompany.* TO 'john'@'%';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,14 @@
CREATE DATABASE IF NOT EXISTS base;
CREATE USER IF NOT EXISTS 'jane'@'%' IDENTIFIED BY 'abc';
GRANT ALL privileges ON base.* TO 'jane'@'%';

CREATE DATABASE IF NOT EXISTS mycompany;
CREATE USER IF NOT EXISTS 'john'@'%' IDENTIFIED BY 'def';
GRANT ALL privileges ON mycompany.* TO 'john'@'%';
CREATE OR REPLACE DATABASE base;
CREATE OR REPLACE DATABASE mycompany;
CREATE OR REPLACE DATABASE inventory;
CREATE OR REPLACE DATABASE inventorymycompany;

CREATE DATABASE IF NOT EXISTS inventory;
CREATE USER IF NOT EXISTS 'jane'@'%' IDENTIFIED BY 'abc';
CREATE OR REPLACE USER 'jane'@'%' IDENTIFIED BY 'abc';
GRANT ALL privileges ON base.* TO 'jane'@'%';
GRANT ALL privileges ON inventory.* TO 'jane'@'%';

CREATE DATABASE IF NOT EXISTS inventorymycompany;
CREATE USER IF NOT EXISTS 'john'@'%' IDENTIFIED BY 'def';
CREATE OR REPLACE USER 'john'@'%' IDENTIFIED BY 'def';
GRANT ALL privileges ON mycompany.* TO 'john'@'%';
GRANT ALL privileges ON inventorymycompany.* TO 'john'@'%';

FLUSH PRIVILEGES;

0 comments on commit 41745fd

Please sign in to comment.