Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Create schema in Heroku Postgresql DB

I'm trying to create a schema in heroku DB. I tried using heroku pg:psql --app app_name DATABASE < schema.sql

schema.sql:

CREATE SCHEMA schema_name AUTHORIZATION user_name;

But my program still says that schema_name doesn't exist. Maybe I'm missing something

like image 922
Antonio Avatar asked Sep 27 '22 18:09

Antonio


1 Answers

I found the problem! I was using Windows console but heroku pg:psql --app app_name DATABASE < schema.sql command didn't work here. I used MINGWN32 console and the following command: cat schema.sql | heroku pg:psql --app app_name and everything worked!

like image 71
Antonio Avatar answered Oct 22 '22 20:10

Antonio