File tree 2 files changed +27
-0
lines changed 2 files changed +27
-0
lines changed Original file line number Diff line number Diff line change @@ -99,6 +99,18 @@ $ docker run -it --rm -v $(pwd)/data:/usr/src/nasgrate/data \
99
99
dlevsha/nasgrate generate MyFirstMigration
100
100
```
101
101
102
+ You can run this line to obtain current ip
103
+
104
+ ``` bash
105
+ docker exec [mysql container name] cat /etc/hosts | tail -n 1 | cut -d$' \t ' -f 1
106
+ ```
107
+
108
+ You can also run bin/migration.sh script (please change params inside it)
109
+
110
+ ``` bash
111
+ ./migration.sh help
112
+ ```
113
+
102
114
Another option is you can view all transactions (executed and non-executed) via web interface. Just run command
103
115
104
116
``` bash
Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+
3
+ # migration scripe
4
+ MIGRATION_FOLDER=[path to migration folder]
5
+ ENV_FILE=[path to .env file]
6
+ MYSQL_CONTAINER_NAME=[mysql container name]
7
+ DOCKER_NETWORK=docker_default
8
+
9
+ CURRENT_IP=$( sudo docker exec $MYSQL_CONTAINER_NAME cat /etc/hosts | tail -n 1 | cut -d$' \t ' -f 1)
10
+ ENV_IP=$( more $ENV_FILE | grep DATABASE_HOST= | cut -d ' =' -f 2)
11
+
12
+ echo ' Current Connection IP -> ' $CURRENT_IP
13
+ echo ' Env File IP -> ' $ENV_IP
14
+
15
+ sudo docker run -it --rm -v $MIGRATION_FOLDER :/usr/src/nasgrate/data --net=$DOCKER_NETWORK --env-file=$ENV_FILE -e DATABASE_HOST=$CURRENT_IP dlevsha/nasgrate " $@ "
You can’t perform that action at this time.
0 commit comments