-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathmigrateDb.sh
executable file
·28 lines (24 loc) · 1008 Bytes
/
migrateDb.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#!/bin/bash -x
#Basic Commands Available
#-------------------------------------------------------------
#migrate: To start running migrations.
#baseline: To "mark" current state of the db as input.
# This won't run existing migrations. They will be skipped.
# If the DB is new, you should run migrate instead.
#status: To show the current status of the migrations table.
#reset: To reset current state of the db. This drops the keyspace and reapplies the script.
# Useful for development.
#
# If no parameter is provided, then the migrate command will be initiated.
#
# For more information:
# https://github.com/ubirch/ubirch-cassandra-eval#how-to-run-httpsgithubcomcobliteamcassandra-migrate
command=$(echo "$1" | awk '{print tolower($0)}')
cd event-log-core/src/main/resources
if [ -z "${command}" ]; then
echo "running migrate"
cassandra-migrate -H 127.0.0.1 -p 9042 migrate
else
echo "running ${command}"
cassandra-migrate -H 127.0.0.1 -p 9042 ${command}
fi