<commit_before># encoding: utf-8
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models

""" I need to go from:

BEGIN;
CREATE TABLE "userena_userenauser" (
    "user_id" integer NOT NULL PRIMARY KEY REFERENCES "auth_user" ("id") DEFERRABLE INITIALLY DEFERRED,
    "last_active" timestamp with time zone,
    "activation_key" varchar(40) NOT NULL,
    "activation_key_created" timestamp with time zone,
    "activation_notification_send" boolean NOT NULL,
    "email_unconfirmed" varchar(75) NOT NULL,
    "email_confirmation_key" varchar(40) NOT NULL,
    "email_confirmation_key_created" timestamp with time zone
)
;
COMMIT;

"""

""" To:

BEGIN;
CREATE TABLE "userena_userena" (
    "id" serial NOT NULL PRIMARY KEY,
    "user_id" integer NOT NULL UNIQUE REFERENCES "auth_user" ("id") DEFERRABLE INITIALLY DEFERRED,
    "last_active" timestamp with time zone,
    "activation_key" varchar(40) NOT NULL,
    "activation_notification_send" boolean NOT NULL,
    "email_unconfirmed" varchar(75) NOT NULL,
    "email_confirmation_key" varchar(40) NOT NULL,
    "email_confirmation_key_created" timestamp with time zone
)
;
COMMIT;

"""

class Migration(SchemaMigration):

    def forwards(self, orm):
        db.rename_table('userena_userenauser', 'userena_userena')
        db.add_column('userena_userena', 'id', models.IntegerField(default=-1), keep_default=False)
        db.delete_primary_key('userena_userena')
        db.create_primary_key('userena_userena', ['id',])
        db.delete_column('userena_userena', 'activation_key_created')

    def backwards(self, orm):
        db.rename_table('userena.userena', 'userena.userenauser')

    models = {
        'auth.group': {
            'Meta': {'object_name': 'Group'},
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
            'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}),
            'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'})
        },
        'auth.permission': {
            'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'},
            'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
            'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}),
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
            'name': ('django.db.models.fields.CharField', [], {'max_length': '50'})
        },
        'auth.user': {
            'Meta': {'object_name': 'User'},
            'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
            'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}),
            'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}),
            'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}),<commit_msg>Added backward migration.<commit_after># encoding: utf-8
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models

""" I need to go from:

BEGIN;
CREATE TABLE "userena_userenauser" (
    "user_id" integer NOT NULL PRIMARY KEY REFERENCES "auth_user" ("id") DEFERRABLE INITIALLY DEFERRED,
    "last_active" timestamp with time zone,
    "activation_key" varchar(40) NOT NULL,
    "activation_key_created" timestamp with time zone,
    "activation_notification_send" boolean NOT NULL,
    "email_unconfirmed" varchar(75) NOT NULL,
    "email_confirmation_key" varchar(40) NOT NULL,
    "email_confirmation_key_created" timestamp with time zone
)
;
COMMIT;

"""

""" To:

BEGIN;
CREATE TABLE "userena_userena" (
    "id" serial NOT NULL PRIMARY KEY,
    "user_id" integer NOT NULL UNIQUE REFERENCES "auth_user" ("id") DEFERRABLE INITIALLY DEFERRED,
    "last_active" timestamp with time zone,
    "activation_key" varchar(40) NOT NULL,
    "activation_notification_send" boolean NOT NULL,
    "email_unconfirmed" varchar(75) NOT NULL,
    "email_confirmation_key" varchar(40) NOT NULL,
    "email_confirmation_key_created" timestamp with time zone
)
;
COMMIT;

"""

class Migration(SchemaMigration):

    def forwards(self, orm):
        db.rename_table('userena_userenauser', 'userena_userena')
        db.add_column('userena_userena', 'id', models.IntegerField(default=-1), keep_default=False)
        db.delete_primary_key('userena_userena')
        db.create_primary_key('userena_userena', ['id',])
        db.delete_column('userena_userena', 'activation_key_created')

    def backwards(self, orm):
        db.rename_table('userena.userena', 'userena.userenauser')
        db.delete_column('userena_userenauser', 'id')
        db.delete_primary_key('userena_userenauser')
        db.create_primary_key('userena_userenauser', ['user_id'])
        db.add_column('userena_userenauser', 'activation_key_created', models.DateTimeField(null=True))

    models = {
        'auth.group': {
            'Meta': {'object_name': 'Group'},
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
            'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}),
            'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'})
        },
        'auth.permission': {
            'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'},
            'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
            'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}),
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
            'name': ('django.db.models.fields.CharField', [], {'max_length': '50'})
        },
        'auth.user': {
            'Meta': {'object_name': 'User'},
            'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
            'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}),
            'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}),
            'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}),
{'fraction_non_alphanumeric': 0.17265454545454545, 'fraction_numerical': 0.0075636363636363635, 'mean_word_length': 4.0521675238795005, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2553076', 'n_tokens_mistral': 2230, 'n_tokens_neox': 2166, 'n_words': 445}