aboutsummaryrefslogtreecommitdiffstats
path: root/mediagoblin/db/sql/util.py
Commit message (Collapse)AuthorAgeFilesLines
* Create function to search media by slug.Elrond2012-03-161-0/+9
| | | | | | | | | Searching media by slug is easy on mongo. But doing the joins in sqlalchemy is not as nice. So created a function for doing it. Well, and create the same function for mongo, so that it also works.
* Generic check_media_slug_used db utility.Elrond2012-03-051-1/+10
| | | | | | | | In two cases (generating a new slug and editing the slug) it is nice to know in advance (before the db gets angry) that the slug is used/free. So created a db utility function to check for this on mongo and sql: check_media_slug_used()
* SQL: Tool to cleanup unused tag slugs.Elrond2012-03-051-0/+22
| | | | | | | | The current SQL layout/sqlalchemy strucuture can't detect whether a slug isn't needed any more and delete it. So provide a tool function to cleanup unused slugs. It's currently not hooked to any gmg function!
* Implement atomic_update for SQL.Elrond2012-03-041-1/+14
| | | | | | On sqlalchemy most updates are atomic enough for most use cases. Anyway, here is an atomic_update that is compatible to the mongo version.
* Excepting that migration 1 doesn't work(!), sqlalchemy migration branch workingChristopher Allan Webber2012-01-291-2/+5
| | | | | | | The reason migration 1 doesn't work, and is commented out, is because of sqlalchemy-migrate not handling certain constraints while dropping binary sqlite columns right. See also: http://code.google.com/p/sqlalchemy-migrate/issues/detail?id=143&thanks=143&ts=1327882242
* Update the string outputs to match our tests: newlines, ...->:, etc.Christopher Allan Webber2012-01-291-2/+2
|
* migrations_to_run here a list, so no reason to call itChristopher Allan Webber2012-01-291-1/+1
|
* self.latest_migration now a property, so we shouldn't __call__ it!Christopher Allan Webber2012-01-291-1/+1
|
* For clarity, self.database -> self.session.Christopher Allan Webber2012-01-291-12/+12
| | | | | Actually, I'm not even sure *that* is ideal! But better than what we had...
* Yet *another* self.database -> self.database.bind fix!Christopher Allan Webber2012-01-291-1/+1
|
* Fix database_current_version for when self.migration_data is None.Christopher Allan Webber2012-01-291-0/+4
|
* another db -> db.bind fix.Christopher Allan Webber2012-01-291-1/+1
|
* A few basic fixes to sql/util.pyChristopher Allan Webber2012-01-291-5/+9
| | | | | | - MigrationRecord to MigrationData, again - If the table doesn't exist, return None for database_current_migration - database.engine -> database.bind
* Also switch database_current_migration to a propertyChristopher Allan Webber2012-01-291-3/+4
|
* Make latest_migration a propertyChristopher Allan Webber2012-01-291-0/+1
|
* Import MigrationData, not MigrationRecordChristopher Allan Webber2012-01-291-3/+3
|
* Another db->db.engine because I'm bad at things ;)Christopher Allan Webber2012-01-291-7/+7
| | | | Thanks again Elrond.
* Another MigrationManager fix.Christopher Allan Webber2012-01-291-1/+1
| | | | self.database -> self.database.engine (thanks again Elrond for the catch)
* assert was positive when it should be negative, fixedChristopher Allan Webber2012-01-291-1/+1
|
* Use .first() instead of [0]... thanks elrond :)Christopher Allan Webber2012-01-291-5/+2
|
* We should probably add that object to the DB also :PChristopher Allan Webber2012-01-291-1/+2
|
* Commit that new migration record ;)Christopher Allan Webber2012-01-291-0/+1
|
* Add create_new_migration_record method to MigrationManagerChristopher Allan Webber2012-01-291-2/+7
|
* Added init_tables method to MigrationManagerChristopher Allan Webber2012-01-291-2/+12
|
* More work on SQL MigrationManagerChristopher Allan Webber2012-01-291-15/+25
| | | | | | | Added methods: - migration_data - database_current_migration - migrations_to_run
* Removing printer argument now that we use self.printerChristopher Allan Webber2012-01-291-1/+1
|
* Finishing the init_or_migrate functionChristopher Allan Webber2012-01-291-1/+7
|
* More work on migration manager, including adding a dry run functionChristopher Allan Webber2012-01-291-6/+76
|
* Beginnings of the SQL migration managerChristopher Allan Webber2012-01-291-1/+100
|
* Big ol' start of the SQL migrations system.Christopher Allan Webber2012-01-291-0/+59
Things definitely don't work yet, but should be heading in the right direction.