-
-
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 migration fails #89
Comments
Looks like SQLite doesn't like the @GrahamCampbell is there a way to change the syntax per-DB driver? |
@jbrooksuk Actually, there's an easier way. Installing doctrine dbal should fix this. Laravel uses it to fill out missing sqlite functionality. |
@GrahamCampbell Oh really? Is it easy to get integrated within a migration, or does it just work once installed? |
It should just work. This is an odd case. Usually laravel will complain that doctrine isn't available. |
Oh yes, you can't use raw statements like that in migrations. That will never work. |
Ok, how do you advise we write migrations? Is there a better way? |
Also tested this against a postgresql database thinking maybe it was a DB specific issue:
I'm out of my element with the new PHP packing systems, but I tried: |
Yes - use laravel's actual functions and classes instead of writing raw code that only works on mysql. |
Sorry - I haven't got time to look into this today for you. |
Ok, I didn't know there was inbuilt functions for things like this, cool! :) |
...just tested with MySQL--works perfectly. |
Rewriting them now :) |
I'm not sure about moving the columns, so I'll drop these migrations as they don't matter really. |
@GrahamCampbell I'm not sure how you write a migration (using sans- |
Just pulled down the patched version and tried against postgres:
|
@darkpixel looks like the migration doesn't like back ticks in PgSql? |
Yeah--backticks are non-standard. MySQL doesn't require them, PostgreSQL doesn't support them. |
Would you mind making a PR and removing the back ticks? Sent from my iPhone
|
I'll give it a shot. |
It looks like the Laraval schema editor doesn't allow changing column types (http://stackoverflow.com/questions/22060398/how-do-i-change-a-column-type-with-laravel-schema-builder) and you have to manually write an SQL alter statement for your databases. I have PostgreSQL and MySQL available on my test server. I'll give it a shot over the next few days. |
Maybe someone can shed some light on the migration process. It's not working like I think it should. I create a clean, new Postgres DB with nothing in it. I run ...as expected. But when I look at the DB, I don't even see an 'incidents' table. The migrations table shows everything applied up to but excluding Manually reviewing the migration files, I can see the incidents table being created in Am I missing some PHP magic? |
Disregard. Found it. Line 17 and 29 should be |
Changed the database.php file to have the following entry:
Create a new sqlite3 database (
sqlite3 /var/hosting/-redacted-/sfdstatus.db ""
) and then ran:The text was updated successfully, but these errors were encountered: