add more db inits
This commit is contained in:
27
db/mariadb/init.sql
Normal file
27
db/mariadb/init.sql
Normal file
@@ -0,0 +1,27 @@
|
||||
CREATE DATABASE demo;
|
||||
USE demo;
|
||||
|
||||
-- a single table is used for all events in the cqrs system
|
||||
CREATE TABLE events
|
||||
(
|
||||
aggregate_type VARCHAR(256) NOT NULL,
|
||||
aggregate_id VARCHAR(256) NOT NULL,
|
||||
sequence bigint CHECK (sequence >= 0) ,
|
||||
payload TEXT ,
|
||||
metadata TEXT ,
|
||||
timestamp timestamp DEFAULT (CURRENT_TIMESTAMP),
|
||||
PRIMARY KEY (aggregate_type, aggregate_id, sequence)
|
||||
);
|
||||
|
||||
CREATE
|
||||
USER
|
||||
'demo_user'@'localhost'
|
||||
IDENTIFIED BY
|
||||
'password';
|
||||
|
||||
GRANT
|
||||
ALL
|
||||
ON
|
||||
demo.*
|
||||
TO
|
||||
'demo_user'@'localhost';
|
||||
Reference in New Issue
Block a user