Skip to content

Commit 597d99d

Browse files
author
Romain Fallet
committed
Move migrations after composer install (if not, fail).
1 parent 490d1d0 commit 597d99d

File tree

2 files changed

+17
-16
lines changed

2 files changed

+17
-16
lines changed

README.md

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,9 @@ The goal is to provide an opinionated, fully tested environment, that just work.
4040
3. [Set up the database and the production mode](#set-up-the-database-and-the-production-mode)
4141
4. [Set permissions](#set-permissions)
4242
5. [Install dependencies and build assets](#install-dependencies-and-build-assets)
43-
6. [Set up the web server](#set-up-the-web-server)
44-
7. [Enabling HTTPS & configure for Symfony](#enabling-https--configure-for-symfony)
43+
6. [Execute database migrations](#execute-database-migrations)
44+
7. [Set up the web server](#set-up-the-web-server)
45+
8. [Enabling HTTPS & configure for Symfony](#enabling-https--configure-for-symfony)
4546
* [Manual configuration: deploy updates of an existing app](#manual-configuration-deploy-updates-of-an-existing-app)
4647
1. [Set up variable](#set-up-variable)
4748
2. [Download updates of our app](#download-updates-of-our-app)
@@ -719,10 +720,6 @@ mv ./.env.local.tmp ./.env.local
719720
# Set mysql credentials
720721
sed -e 's,DATABASE_URL=mysql://db_user:db_password@127.0.0.1:3306/db_name,DATABASE_URL=mysql://'${appname}':'${mysqlpassword}'@127.0.0.1:3306/'${appname}',g' ./.env.local > ./.env.local.tmp
721722
mv ./.env.local.tmp ./.env.local
722-
723-
# Execute database migrations
724-
php bin/console doctrine:migrations:diff
725-
php bin/console doctrine:migrations:migrate -n
726723
```
727724

728725
### Set permissions
@@ -759,6 +756,16 @@ yarn install
759756
yarn build
760757
```
761758

759+
### Execute database migrations
760+
761+
[Back to top ↑](#table-of-contents)
762+
763+
```bash
764+
# Execute database migrations
765+
php bin/console doctrine:migrations:diff
766+
php bin/console doctrine:migrations:migrate -n
767+
```
768+
762769
### Set up the web server
763770

764771
[Back to top ↑](#table-of-contents)

ubuntu18.04_create_app.sh

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -75,16 +75,6 @@ if [ ! $? = 0 ]; then
7575
exit 1
7676
fi
7777

78-
# Execute database migrations
79-
php bin/console doctrine:migrations:diff
80-
if [ ! $? = 0 ]; then
81-
exit 1
82-
fi
83-
php bin/console doctrine:migrations:migrate -n
84-
if [ ! $? = 0 ]; then
85-
exit 1
86-
fi
87-
8878
# Set ownership to Apache
8979
sudo chown -R www-data:www-data /var/www/${appname}
9080
if [ ! $? = 0 ]; then
@@ -121,6 +111,10 @@ if [ ! $? = 0 ]; then
121111
exit 1
122112
fi
123113

114+
# Execute database migrations
115+
php bin/console doctrine:migrations:diff
116+
php bin/console doctrine:migrations:migrate -n
117+
124118
# Create an Apache conf file for the app (copy and paste all stuffs from "cat" to "EOF" in your terminal)
125119
cat > /etc/apache2/sites-available/${appname}.conf <<EOF
126120
# Listen on port 80 (HTTP)

0 commit comments

Comments
 (0)