X-Git-Url: https://git.mdrn.pl/wolnelektury.git/blobdiff_plain/fa5a185ce54eb7bacaadc34f05abb63e701d39d8..e7ef95e5867bba96cb445fef0d8932ab5ed6c938:/apps/api/migrations/0001_initial.py?ds=sidebyside diff --git a/apps/api/migrations/0001_initial.py b/apps/api/migrations/0001_initial.py index 6ac0f5487..a5677524d 100644 --- a/apps/api/migrations/0001_initial.py +++ b/apps/api/migrations/0001_initial.py @@ -12,20 +12,20 @@ class Migration(SchemaMigration): db.create_table('api_deleted', ( ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), ('object_id', self.gf('django.db.models.fields.IntegerField')()), - ('type', self.gf('django.db.models.fields.CharField')(max_length='50')), - ('created_at', self.gf('django.db.models.fields.DateTimeField')()), - ('deleted_at', self.gf('django.db.models.fields.DateTimeField')(auto_now_add=True, blank=True)), + ('content_type', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['contenttypes.ContentType'])), + ('created_at', self.gf('django.db.models.fields.DateTimeField')(db_index=True)), + ('deleted_at', self.gf('django.db.models.fields.DateTimeField')(auto_now_add=True, db_index=True, blank=True)), )) db.send_create_signal('api', ['Deleted']) - # Adding unique constraint on 'Deleted', fields ['type', 'object_id'] - db.create_unique('api_deleted', ['type', 'object_id']) + # Adding unique constraint on 'Deleted', fields ['content_type', 'object_id'] + db.create_unique('api_deleted', ['content_type_id', 'object_id']) def backwards(self, orm): - # Removing unique constraint on 'Deleted', fields ['type', 'object_id'] - db.delete_unique('api_deleted', ['type', 'object_id']) + # Removing unique constraint on 'Deleted', fields ['content_type', 'object_id'] + db.delete_unique('api_deleted', ['content_type_id', 'object_id']) # Deleting model 'Deleted' db.delete_table('api_deleted') @@ -33,12 +33,19 @@ class Migration(SchemaMigration): models = { 'api.deleted': { - 'Meta': {'unique_together': "(('type', 'object_id'),)", 'object_name': 'Deleted'}, - 'created_at': ('django.db.models.fields.DateTimeField', [], {}), - 'deleted_at': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), + 'Meta': {'unique_together': "(('content_type', 'object_id'),)", 'object_name': 'Deleted'}, + 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), + 'created_at': ('django.db.models.fields.DateTimeField', [], {'db_index': 'True'}), + 'deleted_at': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'db_index': 'True', 'blank': 'True'}), 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'object_id': ('django.db.models.fields.IntegerField', [], {}), - 'type': ('django.db.models.fields.CharField', [], {'max_length': "'50'"}) + 'object_id': ('django.db.models.fields.IntegerField', [], {}) + }, + 'contenttypes.contenttype': { + 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, + 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), + 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) } }