-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: tests and include test migrations
- Loading branch information
Showing
8 changed files
with
53 additions
and
18 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
/target | ||
migrations | ||
!test/migrations |
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
-- DROP TABLE test; |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
create keyspace if not exists scyllax with replication = { | ||
'class': 'SimpleStrategy', | ||
'replication_factor': 1 | ||
}; | ||
|
||
create table if not exists scyllax.person ( | ||
id timeuuid primary key, | ||
email text, | ||
age int, | ||
data text, -- json type | ||
kind int, | ||
-- camel case for the sake of backwards compat | ||
"createdAt" timestamp | ||
); | ||
|
||
create materialized view if not exists scyllax.person_by_email as | ||
select * | ||
from person | ||
where email is not null and id is not null | ||
primary key (email, id); | ||
|
||
insert into scyllax.person(id, email, age, data, kind, "createdAt") values (e01e84d6-414c-11ee-be56-0242ac120002, '[email protected]', 25, '{"foo":"bar"}', 0, toUnixTimestamp(now())); | ||
|
||
insert into scyllax.person(id, email, age, kind, "createdAt") values (e01e880a-414c-11ee-be56-0242ac120002, '[email protected]', 25, 1, toUnixTimestamp(now())); | ||
|
||
create table if not exists scyllax.person_login ( | ||
id timeuuid, | ||
person_id uuid, | ||
count counter, | ||
primary key ((id), person_id) | ||
); | ||
|
||
update scyllax.person_login set count = count + 0 where id = 42dcfcde-5420-11ee-8c99-0242ac120002 and person_id = e01e84d6-414c-11ee-be56-0242ac120002; |