Last active
July 27, 2018 17:36
-
-
Save navicore/b9032dd79c66f6fb3e76da285e545f4a to your computer and use it in GitHub Desktop.
akka cockroachdb sql init
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CREATE database akka; | |
DROP TABLE IF EXISTS akka.journal; | |
CREATE TABLE IF NOT EXISTS akka.journal ( | |
ordering BIGSERIAL, | |
persistence_id VARCHAR(255) NOT NULL, | |
sequence_number BIGINT NOT NULL, | |
deleted BOOLEAN DEFAULT FALSE, | |
tags VARCHAR(255) DEFAULT NULL, | |
message BYTEA NOT NULL, | |
PRIMARY KEY(persistence_id, sequence_number) | |
); | |
CREATE UNIQUE INDEX journal_ordering_idx ON akka.journal(ordering); | |
DROP TABLE IF EXISTS akka.snapshot; | |
CREATE TABLE IF NOT EXISTS akka.snapshot ( | |
persistence_id VARCHAR(255) NOT NULL, | |
sequence_number BIGINT NOT NULL, | |
created BIGINT NOT NULL, | |
snapshot BYTEA NOT NULL, | |
PRIMARY KEY(persistence_id, sequence_number) | |
); | |
CREATE USER akka; | |
GRANT ALL on database akka to akka; | |
GRANT ALL on table akka.* to akka; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment