forked from golang-migrate/migrate
-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
31 changed files
with
1,205 additions
and
284 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
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 |
---|---|---|
|
@@ -87,7 +87,6 @@ release: | |
prerelease: auto | ||
source: | ||
enabled: true | ||
rlcp: true | ||
format: zip | ||
changelog: | ||
skip: false | ||
|
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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
FROM alpine:3.18 | ||
FROM alpine:3.19 | ||
|
||
RUN apk add --no-cache ca-certificates | ||
|
||
|
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
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
10 changes: 10 additions & 0 deletions
10
database/clickhouse/examples/migrations/003_create_database.down.sql
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,10 @@ | ||
DROP TABLE IF EXISTS driver_ratings; | ||
DROP TABLE IF EXISTS user_ratings; | ||
DROP TABLE IF EXISTS orders; | ||
DROP TABLE IF EXISTS driver_ratings_queue; | ||
DROP TABLE IF EXISTS user_ratings_queue; | ||
DROP TABLE IF EXISTS orders_queue; | ||
DROP VIEW IF EXISTS user_ratings_queue_mv; | ||
DROP VIEW IF EXISTS driver_ratings_queue_mv; | ||
DROP VIEW IF EXISTS orders_queue_mv; | ||
DROP DATABASE IF EXISTS analytics; |
81 changes: 81 additions & 0 deletions
81
database/clickhouse/examples/migrations/003_create_database.up.sql
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,81 @@ | ||
CREATE DATABASE IF NOT EXISTS analytics; | ||
|
||
CREATE TABLE IF NOT EXISTS analytics.driver_ratings( | ||
rate UInt8, | ||
userID Int64, | ||
driverID String, | ||
orderID String, | ||
inserted_time DateTime DEFAULT now() | ||
) ENGINE = MergeTree | ||
PARTITION BY driverID | ||
ORDER BY (inserted_time); | ||
|
||
CREATE TABLE analytics.driver_ratings_queue( | ||
rate UInt8, | ||
userID Int64, | ||
driverID String, | ||
orderID String | ||
) ENGINE = Kafka | ||
SETTINGS kafka_broker_list = 'broker:9092', | ||
kafka_topic_list = 'driver-ratings', | ||
kafka_group_name = 'rating_readers', | ||
kafka_format = 'Avro', | ||
kafka_max_block_size = 1048576; | ||
|
||
CREATE MATERIALIZED VIEW analytics.driver_ratings_queue_mv TO analytics.driver_ratings AS | ||
SELECT rate, userID, driverID, orderID | ||
FROM analytics.driver_ratings_queue; | ||
|
||
CREATE TABLE IF NOT EXISTS analytics.user_ratings( | ||
rate UInt8, | ||
userID Int64, | ||
driverID String, | ||
orderID String, | ||
inserted_time DateTime DEFAULT now() | ||
) ENGINE = MergeTree | ||
PARTITION BY userID | ||
ORDER BY (inserted_time); | ||
|
||
CREATE TABLE analytics.user_ratings_queue( | ||
rate UInt8, | ||
userID Int64, | ||
driverID String, | ||
orderID String | ||
) ENGINE = Kafka | ||
SETTINGS kafka_broker_list = 'broker:9092', | ||
kafka_topic_list = 'user-ratings', | ||
kafka_group_name = 'rating_readers', | ||
kafka_format = 'JSON', | ||
kafka_max_block_size = 1048576; | ||
|
||
CREATE MATERIALIZED VIEW analytics.user_ratings_queue_mv TO analytics.user_ratings AS | ||
SELECT rate, userID, driverID, orderID | ||
FROM analytics.user_ratings_queue; | ||
|
||
CREATE TABLE IF NOT EXISTS analytics.orders( | ||
from_place String, | ||
to_place String, | ||
userID Int64, | ||
driverID String, | ||
orderID String, | ||
inserted_time DateTime DEFAULT now() | ||
) ENGINE = MergeTree | ||
PARTITION BY driverID | ||
ORDER BY (inserted_time); | ||
|
||
CREATE TABLE analytics.orders_queue( | ||
from_place String, | ||
to_place String, | ||
userID Int64, | ||
driverID String, | ||
orderID String | ||
) ENGINE = Kafka | ||
SETTINGS kafka_broker_list = 'broker:9092', | ||
kafka_topic_list = 'orders', | ||
kafka_group_name = 'order_readers', | ||
kafka_format = 'Avro', | ||
kafka_max_block_size = 1048576; | ||
|
||
CREATE MATERIALIZED VIEW analytics.orders_queue_mv TO orders AS | ||
SELECT from_place, to_place, userID, driverID, orderID | ||
FROM analytics.orders_queue; |
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
Oops, something went wrong.