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:
parent
75956de7d1
commit
9b9f90d91c
13 changed files with 670 additions and 145 deletions
54
src/config/migrations/0001_initial.py
Normal file
54
src/config/migrations/0001_initial.py
Normal file
|
|
@ -0,0 +1,54 @@
|
|||
# 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']
|
||||
Loading…
Add table
Add a link
Reference in a new issue