-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Database migrations #778
Comments
Sorry, I wrote something weird |
@bocharsky-bw Not using migrations is not best practice. @lsv There are no migrations because nobody made them. One important thing discussed earlier is to make demo work without running migrations or doing anything except |
@bocharsky-bw using migrations for production instead of using |
@bocharsky-bw well, its actually better using migration than fixtures in production imo @jkufner This will still work, due to the sqlite database is provided, though it would be lovely to also try symfony demo on other databases like postgresql, mysql, mariadb, mssql. And I also think, it will give "best practice" on how not to rely on a single database manufactur |
Sorry guys, somehow I was thinking about "fixtures" instead of "migrations". Of course, migrations sound totally great for production 👍 |
Initial migration for multiple DBMS sound weird to me with I don't know if something similar to Django migrations is provided for another Symfony bundle, but IMHO starting with |
@yceruto And as this is a demo, I think it should enforce best practices, and as DoctrineFixtures only installs in dev and test mode by default (by its flex recipe) And true, DoctrineMigrations it will create pure SQL statements, which will be different pr database provider, and therefor this demo will also work on mysql, postgres etc where now it only works with sqlite (which is not the best performer). I like to think that somebody uses this demo as a base for there system, and will develop it into something bigger, and "help" them so they also can use other DBMS will be great, in my mind. |
Yes, I mean from scratch. Currently we can run
|
That depends on what "demo" should be. Is is just a show case of random data and clicking around (front wise), or is it to show best practice from symfony, on "how to code things" (code wise). Maybe I'm much more interested in the actually code than the frontend :) Actually if you are installing from scratch it should not have any data at all - Only for the heroku it should have data. Now I dont know what you can do behind the scene to deploy on heroku (commands). But still in my PR I have kept the blog.sqlite (which already have fixtures installed) so no commands are needed to see the demo. (but its now possible to also use other DBMS) |
What is the best practice to populate the initial data on production? |
In my mind its using migrations. (though in this demo) its not actually data, but more like test data. Like in a fresh wordpress installation you would not start with 50 blog posts, but maybe just one "Hello World" post - And this "Hello World" post I would add in the migration. But for dev/test environment you will also have the initial migration, but are able to run |
Why not use migrations to create the database, instead of relying on sqlite, so other RDBMS could be used
I will gladly make real migrations to use if needed
The text was updated successfully, but these errors were encountered: