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.
This commit is contained in:
Griatch 2011-03-21 00:53:58 +00:00
parent 75956de7d1
commit 9b9f90d91c
13 changed files with 670 additions and 145 deletions

View file

@ -0,0 +1,43 @@
# 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 'HelpEntry'
db.create_table('help_helpentry', (
('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
('db_key', self.gf('django.db.models.fields.CharField')(unique=True, max_length=255)),
('db_help_category', self.gf('django.db.models.fields.CharField')(default='General', max_length=255)),
('db_entrytext', self.gf('django.db.models.fields.TextField')(blank=True)),
('db_permissions', self.gf('django.db.models.fields.CharField')(max_length=255, blank=True)),
('db_lock_storage', self.gf('django.db.models.fields.TextField')(blank=True)),
('db_staff_only', self.gf('django.db.models.fields.BooleanField')(default=False)),
))
db.send_create_signal('help', ['HelpEntry'])
def backwards(self, orm):
# Deleting model 'HelpEntry'
db.delete_table('help_helpentry')
models = {
'help.helpentry': {
'Meta': {'object_name': 'HelpEntry'},
'db_entrytext': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
'db_help_category': ('django.db.models.fields.CharField', [], {'default': "'General'", 'max_length': '255'}),
'db_key': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '255'}),
'db_lock_storage': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
'db_permissions': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}),
'db_staff_only': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'})
}
}
complete_apps = ['help']