sc3 / cookcountyjail

A Django app that tracks the population of Cook County Jail over time and summarizes trends.
http://cookcountyjail.recoveredfactory.net/api/1.0/?format=json
Other
31 stars 23 forks source link

Sqlite DROP migrations #365

Closed wilbertom closed 10 years ago

wilbertom commented 10 years ago

So it looks like sqlite doesn't support the DROP statement. This means that using alembic migrations we won't be able to use sqlite. So we either find another migration module or switch databases during development. After we decide I can push my code to close #353 and #348.

  File "/home/wil/Programming/.virtualenvs/ccj/local/lib/python2.7/site-packages/sqlalchemy/util/compat.py", line 185, in raise_from_cause
    reraise(type(exception), exception, tb=exc_tb)
  File "/home/wil/Programming/.virtualenvs/ccj/local/lib/python2.7/site-packages/sqlalchemy/engine/base.py", line 940, in _execute_context
    context)
  File "/home/wil/Programming/.virtualenvs/ccj/local/lib/python2.7/site-packages/sqlalchemy/engine/default.py", line 435, in do_execute
    cursor.execute(statement, parameters)
sqlalchemy.exc.OperationalError: (OperationalError) near "DROP": syntax error u'ALTER TABLE charge DROP COLUMN primary_type' ()

source 1 source 2

I think we should just switch to postre on development too since we are already using it on the server.

What do you guys think.

bepetersn commented 10 years ago

Looks like that's true. We are going to use pgsql on the server anyway, so we should set it up.

So it looks like sqlite doesn't support the DROP statement. This means that using alembic migrations we won't be able to use sqlite. So we either find another migration module or switch databases during development. After we decide I can push my code to close

353https://github.com/sc3/cookcountyjail/issues/353and

348 https://github.com/sc3/cookcountyjail/issues/348.

File "/home/wil/Programming/.virtualenvs/ccj/local/lib/python2.7/site-packages/sqlalchemy/util/compat.py", line 185, in raise_from_cause reraise(type(exception), exception, tb=exc_tb) File "/home/wil/Programming/.virtualenvs/ccj/local/lib/python2.7/site-packages/sqlalchemy/engine/base.py", line 940, in _execute_context context) File "/home/wil/Programming/.virtualenvs/ccj/local/lib/python2.7/site-packages/sqlalchemy/engine/default.py", line 435, in do_execute cursor.execute(statement, parameters) sqlalchemy.exc.OperationalError: (OperationalError) near "DROP": syntax error u'ALTER TABLE charge DROP COLUMN primary_type' ()

source 1 https://bugs.launchpad.net/neutron/+bug/1241952 source 2https://bitbucket.org/zzzeek/alembic/issue/21/column-renames-not-supported-on-sqlite

I think we should just switch to postre on development too since we are already using it on the server.

What do you guys think.

— Reply to this email directly or view it on GitHubhttps://github.com/sc3/cookcountyjail/issues/365 .

bepetersn commented 10 years ago

We've switched to pgsql now, correct?

wilbertom commented 10 years ago

Yup,