# Generated by Django 4.2 on 2023-05-01 12:37

from django.db import migrations, models
import django.db.models.deletion
import django_bleach.models
from django.conf import settings


class Migration(migrations.Migration):

	initial = True

	dependencies = [
		('auth', '__first__'),
		migrations.swappable_dependency(settings.AUTH_USER_MODEL),
		('sites', '__first__'),
	]

	operations = [
		migrations.CreateModel(
			name='FileData',
			fields=[
				('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
				('description', models.CharField(blank=True, max_length=512)),
				('uploaded_at', models.DateTimeField(auto_now_add=True)),
				('file', models.FileField(upload_to='')),
			],
			options={
				'abstract': False,
			},
		),
		migrations.CreateModel(
			name='ImageData',
			fields=[
				('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
				('description', models.CharField(blank=True, max_length=512)),
				('uploaded_at', models.DateTimeField(auto_now_add=True)),
				('file', models.ImageField(height_field='height', upload_to='', width_field='width')),
				('height', models.PositiveIntegerField(default=0)),
				('width', models.PositiveIntegerField(default=0)),
			],
			options={
				'abstract': False,
			},
		),
		migrations.CreateModel(
			name='Page',
			fields=[
				('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
				('key', models.CharField(max_length=64)),
				('title', models.CharField(max_length=128)),
				('title_en', models.CharField(max_length=128, null=True)),
				('title_es', models.CharField(max_length=128, null=True)),
				('description', models.CharField(blank=True, max_length=256)),
				('description_en', models.CharField(blank=True, max_length=256, null=True)),
				('description_es', models.CharField(blank=True, max_length=256, null=True)),
				('site', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='sites.site')),
			],
			options={
				'unique_together': {('site', 'key')},
			},
		),
		migrations.CreateModel(
			name='Text',
			fields=[
				('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
				('key', models.CharField(max_length=64)),
				('content', django_bleach.models.BleachField()),
				('content_en', django_bleach.models.BleachField(null=True)),
				('content_es', django_bleach.models.BleachField(null=True)),
				('page', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='drf_cms.page')),
			],
			options={
				'abstract': False,
				'unique_together': {('page', 'key')},
			},
		),
		migrations.CreateModel(
			name='Image',
			fields=[
				('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
				('key', models.CharField(max_length=64)),
				('content', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='drf_cms.imagedata')),
				('page', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='drf_cms.page')),
			],
			options={
				'abstract': False,
				'unique_together': {('page', 'key')},
			},
		),
		migrations.CreateModel(
			name='File',
			fields=[
				('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
				('key', models.CharField(max_length=64)),
				('content', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='file_data', to='drf_cms.filedata')),
				('page', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='drf_cms.page')),
			],
			options={
				'abstract': False,
				'unique_together': {('page', 'key')},
			},
		),
	]
