94 Commits

Author SHA1 Message Date
Elrond
c130e3ee79 Move db.sql.migration_tools to db.migration_tools.
Follow the new trend.
2013-01-08 22:50:01 +01:00
Elrond
a050e776c6 Move all the migration tools into new migration_tools.py
Factor all the migration related stuff out into a new
.db.sql.migration_tools.
First we don't have to load this module for our normal
server.
Second it makes all the import dependencies a little more
cleaner.
2013-01-08 22:50:01 +01:00
Sebastian Spaeth
b0c8328e54 Move db.sql.models* to db.models* 2013-01-07 11:44:29 +01:00
Sebastian Spaeth
1e46dc2537 Move db.sql.util to db.util
Now that sqlalchemy is providing the database abstractions, there is no
need to hide everything in db.sql. sub-modules. It complicates the code
and provides a futher layer of indirection.

Move the db.sql.util.py to db.util.py and adapt the importers.
2013-01-07 11:31:56 +01:00
Sebastian Spaeth
9536988425 Move db.sql.migrations to db.migrations 2012-12-25 20:12:16 +01:00
Sebastian Spaeth
6eddc3b75e Move db.sql.open to db.open
Now that mongo has been ripped out and sqlalchemy is already providing
the database abstraction, there is no need to hide everything in the sql
module. Transition db.sql.open to db.open and adapt all direct importers.
2012-12-25 20:09:43 +01:00
Sebastian Spaeth
bc142abc55 RIP out mongo
Since sqlalchemy is providing our database abstraction and we have
moved away from Mongo as the underlying database, it is now time to
simplify things and rip out mongo. This provides the bulk of the
changes, and can stand on its own. There are some followup tasks
that can be done, such as removing now unneeded abstraction layers,
e.g. db.sql.fake.py
2012-12-25 20:06:03 +01:00
Elrond
b39d1f2351 Mongo removal: Remove the validate=True arg to obj.save()
all callers were forced to use validate=True anyway. So
remove this useless stuff.
2012-12-24 00:07:24 +01:00
Sebastian Spaeth
4d9b426ccf Try ipython-based shell first, falling back to plain shell
Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
2012-12-19 10:33:29 +01:00
Christopher Allan Webber
b28005984c makeadmin and changepasswd had swapped help text 2012-12-18 16:46:20 -06:00
Joar Wandborg
30520c92cc Fixed tests
- Adapt tests to new global_config arg for run_dbupdate
- Account for [plugins] not being set in config
2012-09-15 17:54:34 +02:00
Joar Wandborg
f46e2a4db9 Add OAuth models, plugin DB migrations, api_auth 2012-09-13 20:38:59 +02:00
Aleksej
9d3e56d500 replaced os.path.split()[0] with os.path.dirname() and corrected a couple of comments 2012-08-13 16:07:58 +04:00
Christopher Allan Webber
5257f5f554 Duplication of rstrip unnecessary in link_assets function
Thanks for catching AVRS!
2012-08-12 12:49:14 -04:00
Christopher Allan Webber
777908759c Setup the scaffolding for theme installing, but it doesn't work yet 2012-07-14 13:32:11 -05:00
Christopher Allan Webber
3da44aeba1 Break the asset linking code off into a reusable function
In the future, the install command should be able to use that as well.
2012-07-14 13:23:12 -05:00
Christopher Allan Webber
8a22617ffe asset linking command now works 2012-07-14 12:55:14 -05:00
Christopher Allan Webber
111a97524a Start of the ./bin/gmg theme assetlink command.
Mostly works but doesn't handle all the places it could break.
2012-07-14 12:55:14 -05:00
Brett Smith
a00ac32045 Make sure MigrationManagers always get Unicode names.
If we fail to do this, SQLAlchemy complains that we're binding a
non-Unicode value to a Unicode column.
2012-07-04 10:54:44 -04:00
Will Kahn-Greene
a855e92a98 Fix problems from pyflakes output 2012-06-03 15:53:34 -04:00
Christopher Allan Webber
088644a80b Deprecate ./bin/gmg migrate.
Keeping it around just in case someone manually wants to migrate
before running the convert thing or... something.  Probably silly.
2012-04-29 12:08:44 -05:00
Christopher Allan Webber
63578ee395 Removing wipealldata command and deleting env_export/env_import for now.
None of these tools really work anymore in the SQL world, and possibly
aren't as necessary either.  In the meanwhile, just disabling them to
reduce confusion.
2012-04-29 11:45:48 -05:00
Joar Wandborg
c8bee965ad gmg env_import shouldn't crash on unicode ...
characters in media titles
2012-04-02 15:08:22 +02:00
Christopher Allan Webber
d693f6bd86 SQL based tests and refactored Celery setup stuff
- Changed config files of test configs to use SQL
 - Updated celery initialization tools, factored them to be able to
   use the "big instance" application stuff
2012-03-26 11:14:11 -05:00
Jakob Kramer
9edd71ebf7 Wipe the configured database, not the default one 2012-03-24 15:33:36 +01:00
Christopher Allan Webber
9e55431143 mongo->sql conversion script now runs mongo migrations first, just in case 2012-03-17 17:08:46 -05:00
Christopher Allan Webber
431811eb36 Mongosql imports made celery get set up before we wanted it via ./bin/gmg commands
Just moved the import into the actual function.  That resolved the issue!
2012-03-17 12:31:11 -05:00
Christopher Allan Webber
956335c839 Removing an unnecessary line of whitespace AND crediting Hugo Boyer for the ipython code!
Thanks Hugo Boyer!  I forgot to credit you in my last commit.
2012-03-14 16:03:09 -05:00
Christopher Allan Webber
0e93443f59 ipython support in ./bin/gmg shell! 2012-03-14 16:00:34 -05:00
Elrond
9891351256 Create "gmg convert_mongo_to_sql" command
Finally, to make testing of sql a bit easier, create a
bin/gmg command to do the conversion from mongo to sql.
It's currently named "convert_mongo_to_sql".

The most important option is the gmg -cf option to give a
configfile with the appropiate sql_engine definition.
2012-02-23 23:49:09 +01:00
Christopher Allan Webber
3ea1cf36fc Updates so that dbupdate command works
- Various fixes to dbupdate itself
 - Switching db/sql/migrations.py to use a dict instead of a list
 - Registering the function
2012-02-18 23:19:09 -06:00
Christopher Allan Webber
63352aaf70 Merge branch 'master' into sqlmigrate
Conflicts:
	mediagoblin/db/sql/models.py
2012-02-18 10:01:47 -06:00
Christopher Allan Webber
cf29e8a824 It's 2012 all up in here 2012-02-02 09:44:13 -06:00
Christopher Allan Webber
3f2c6f96c1 No need for self here (thanks again Elrond ;)) 2012-01-29 16:33:45 -06:00
Christopher Allan Webber
70b44584ae Big ol' start of the SQL migrations system.
Things definitely don't work yet, but should be heading in the right direction.
2012-01-29 16:33:44 -06:00
Elrond
228c4470f4 Dot-Notation for MediaEntry.media_files 2012-01-04 11:57:39 +01:00
Elrond
690672580e Fix "bin/gmg migrate" after mongo move
When moving most stuff from db to db/mongo, "gmg migrate"
was left out.

Fix it now!
2011-12-28 23:46:36 +01:00
Joar Wandborg
8eb216388f Fixed import_export
- Mongokit instead of pymongo
- db.MediaEntry instead of db.media_entry (pymongo style)
2011-12-15 23:49:52 +01:00
Elrond
ec82fbd85c Dot-Notation for MediaEntry.title 2011-12-05 21:08:58 +01:00
Elrond
bec591d85b Dot-Notation for Users.is_admin 2011-12-05 21:08:57 +01:00
Elrond
7a3d00ec21 Dot-Notation for Users.status 2011-12-05 21:08:57 +01:00
Elrond
4facc7a0a2 Dot-Notation for Users.email_verified 2011-12-05 21:08:57 +01:00
Elrond
9047b254f3 Dot-Notation for Users.pw_hash 2011-12-05 21:08:57 +01:00
Elrond
809cbfc5ab Dot-Notation for Users.email 2011-12-05 21:08:57 +01:00
Elrond
5a4e3ff1e2 Dot-Notation for Users.username 2011-12-05 21:08:57 +01:00
Christopher Allan Webber
bb20c179c4 Most users won't see this but having space after prompt still nice for passwords. 2011-12-03 21:59:52 -06:00
Christopher Allan Webber
bbac7663f4 PEP-8'ifying prompt_if_not_set 2011-12-03 21:56:30 -06:00
Manuel Urbano Santos
7d98005a6b Prompt for arguments in adduser if not present (I created a function in util.py to check and prompt for arguments). 2011-12-03 15:36:02 +01:00
Manuel Urbano Santos
d463055317 Change adduser arguments from positional to --keyword style. 2011-12-03 14:29:28 +01:00
Elrond
5568a01419 Use setup_global_and_app_config in gmg's migrate.
Instead of using read_mediagoblin_config, forgetting to
check the validation report and then finding the main app
section by hand, just use setup_global_and_app_config.
2011-11-26 11:50:25 +01:00