evennia/src/config/migrations/0001_initial.py
Griatch 9b9f90d91c gtaylor convinced me to add migrations to the Evennia repo. This means that game/migrate.py is no more. The migrations will help you to adjust your database when Evennia releases a new database change, no need to drop the database or manually adjust tables. To make use of our schema migrations, you need to have Django-South installed.
To convert to django-south operations, easiest is if you are willing to drop your old database (e.g. delete evennia.db if you use default sqlite3). Then do: "game/manage.py syncdb" followed by "game/manage.py migrate". That should do it. If you ever deletes your database, just rerun those two commands.

If you want to convert an existing database, do
game/manage.py convert_to_south comms
game/manage.py convert_to_south config
game/manage.py convert_to_south help
game/manage.py convert_to_south objects
game/manage.py convert_to_south players
game/manage.py convert_to_south scripts


In the future, you will then be able to do ./manage.py migrate when we tell you the schema has changed.
2011-03-21 00:53:58 +00:00

54 lines
2.1 KiB
Python

# encoding: utf-8
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding model 'ConfigValue'
db.create_table('config_configvalue', (
('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
('db_key', self.gf('django.db.models.fields.CharField')(max_length=100)),
('db_value', self.gf('django.db.models.fields.TextField')()),
))
db.send_create_signal('config', ['ConfigValue'])
# Adding model 'ConnectScreen'
db.create_table('config_connectscreen', (
('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
('db_key', self.gf('django.db.models.fields.CharField')(max_length=255, blank=True)),
('db_text', self.gf('django.db.models.fields.TextField')()),
('db_is_active', self.gf('django.db.models.fields.BooleanField')(default=True)),
))
db.send_create_signal('config', ['ConnectScreen'])
def backwards(self, orm):
# Deleting model 'ConfigValue'
db.delete_table('config_configvalue')
# Deleting model 'ConnectScreen'
db.delete_table('config_connectscreen')
models = {
'config.configvalue': {
'Meta': {'object_name': 'ConfigValue'},
'db_key': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
'db_value': ('django.db.models.fields.TextField', [], {}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'})
},
'config.connectscreen': {
'Meta': {'object_name': 'ConnectScreen'},
'db_is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}),
'db_key': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}),
'db_text': ('django.db.models.fields.TextField', [], {}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'})
}
}
complete_apps = ['config']