frontend: introduce MigrateVersion as a Django model

So that it will be created by Django's manage script syncdb command.

Signed-off-by: Cleber Rosa <crosa@redhat.com>
database: remove the migrate step completely

So that the effects of not using the schema SQL file can be seen.

Signed-off-by: Cleber Rosa <crosa@redhat.com>
database: set tko_test_view_2 model as not managed

So that the table (we want a view) is not created and thus does not
have to be cleaned up.

Signed-off-by: Cleber Rosa <crosa@redhat.com>
database: make custom SQL compatible with MySQL

Signed-off-by: Cleber Rosa <crosa@redhat.com>
database: only try to create functions if appropriate

Signed-off-by: Cleber Rosa <crosa@redhat.com>
database: model fixes for AclGroup

Signed-off-by: Cleber Rosa <crosa@redhat.com>
database: model fixes for Test

Signed-off-by: Cleber Rosa <crosa@redhat.com>
database: model fixes for HostAttribute

Signed-off-by: Cleber Rosa <crosa@redhat.com>
database: introduce database manager module

A wrapper for managing database instances. Currently implementations
for managing database instances exist for:

 * MySQL
 * PostgreSQL
 * SQLite (via "Dummy" manager)

Signed-off-by: Cleber Rosa <crosa@redhat.com>
autotest-database-turnkey: add option to read configuration from file

So that a different use case is also possible, that is, a user manually
edits a file, and wants to setup his database from that configuration.

Signed-off-by: Cleber Rosa <crosa@redhat.com>
autotest-database-turnkey: use database manager functionality

This should make autotest-database-turnkey support other database
database backends transparently.

Signed-off-by: Cleber Rosa <crosa@redhat.com>
database: allow to run unittests against other database backends.

By using the new database management module.

WARNING: it's currently necessary to edit the code to run the
unittests against other database backends. This is done on purpose
because running the database unittests involve creating and dropping
the database and may result in data loss if pointed to your production
database.

Signed-off-by: Cleber Rosa <crosa@redhat.com>
database: renamed database dir to database_legacy

Signed-off-by: Cleber Rosa <crosa@redhat.com>
database: moved frontend migration files to database_legacy

Signed-off-by: Cleber Rosa <crosa@redhat.com>
database: get rid of the tko migration files

Since the tko database has been merged into the AUTOTEST_WEB database
for far too long (2009), so IMHO this is not something we want to carry
around.

Signed-off-by: Cleber Rosa <crosa@redhat.com>
frontend: add database migrate versioninig info to fixture file

Signed-off-by: Cleber Rosa <crosa@redhat.com>
installation_support/autotest-database-turnkey: adapt to settings module

It's pretty akward to support both the old (global_config) and new
(settings) module, so just support the latter.

Signed-off-by: Cleber Rosa <crosa@redhat.com>
database: add SQL for creating tko_test_view_2

This file is in a location similar to the fixtures files, that is,
Django will automatically load its content (in this case run this
SQL) at database sync time.

Signed-off-by: Cleber Rosa <crosa@redhat.com>
database: use definition of tko_test_view_2 from external file

Instead of having another hardcoded SQL code embedded into the
source code.

Signed-off-by: Cleber Rosa <crosa@redhat.com>
database/south: add it to list of django apps

Since the custom database migration code has been deprecated, introduce
south as a more widely used and better supported alternative.

Signed-off-by: Cleber Rosa <crosa@redhat.com>