Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
926 views
in Technique[技术] by (71.8m points)

php - Deploy Symfony 5 on Heroku

I'm trying to deploy Symfony application with heroku. To do this I've followed the official doc from Heroku.

Next , the command git push heroku masterreturn me an error : missing variable DATABASE_URL

So, I've added the ressource ClearDB to manage my app with MySQL.

In the config vars , ClearDB has added CLEARDB_DATABASE_URL , and following this tutoriel , I've add DATABASE_URL with the value of CLEARDB_DATABASE_URL.

Actually I've this :

config_vars In my Procfile, I've added release to execute command for all deploys :

release: php bin/console cache:clear && php bin/console cache:warmup && php bin/console doctrine:migrations:migrate

But I got an error when I push on heroku master :

error_shell To verify this error , I'm connecting to my DB with Sequel Pro, and the tables are presents.

I don't understand why heroku doesn't detect my last migration. For exemple in local this message is sent :

Already at the latest version

but not on the Heroku shell. Also , when I remove alls tables and migrate again, the message :

There is no active transaction

is sent, but on local I got :

Success!

I don't understand the differents comportements between Heroku / local shell


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

It sounds like you made the migration on a different machine with a different database. You need to make the migration on the server so that it will make the necessary changes for the current database state.

Your migration is failing because it is trying to create a table 'article' when it already exists. Therefore, your migration cannot and, should not be run.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...