Module todo.migrations.0001_initial
Expand source code
# MIT License
# Copyright © 2024 Akarsh Reddy Eathamukkala
# Permission is hereby granted, free of charge, to any person obtaining a copy of
# this software and associated documentation files (the “Software”), to deal in
# the Software without restriction, including without limitation the rights to
# use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
# of the Software, and to permit persons to whom the Software is furnished to
# do so, subject to the following conditions:
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
# THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS
# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
# IN THE SOFTWARE.
# Generated by Django 4.1.1 on 2022-11-21 03:33
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
operations = [
migrations.CreateModel(
name='List',
fields=[
('id', models.BigAutoField(auto_created=True,
primary_key=True, serialize=False, verbose_name='ID')),
('title_text', models.CharField(max_length=100)),
('created_on', models.DateTimeField()),
('updated_on', models.DateTimeField()),
('list_tag', models.CharField(default='none', max_length=50)),
('is_shared', models.BooleanField(default=False)),
('user_id', models.ForeignKey(blank=True, null=True,
on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
],
),
migrations.CreateModel(
name='Template',
fields=[
('id', models.BigAutoField(auto_created=True,
primary_key=True, serialize=False, verbose_name='ID')),
('title_text', models.CharField(max_length=100)),
('created_on', models.DateTimeField()),
('updated_on', models.DateTimeField()),
('user_id', models.ForeignKey(blank=True, null=True,
on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
],
),
migrations.CreateModel(
name='TemplateItem',
fields=[
('id', models.BigAutoField(auto_created=True,
primary_key=True, serialize=False, verbose_name='ID')),
('item_text', models.CharField(max_length=100)),
('created_on', models.DateTimeField()),
('finished_on', models.DateTimeField()),
('due_date', models.DateField()),
('tag_color', models.CharField(max_length=10)),
('template', models.ForeignKey(
on_delete=django.db.models.deletion.CASCADE, to='todo.template')),
],
),
migrations.CreateModel(
name='SharedUsers',
fields=[
('id', models.BigAutoField(auto_created=True,
primary_key=True, serialize=False, verbose_name='ID')),
('shared_user', models.CharField(max_length=200)),
('list_id', models.ForeignKey(
on_delete=django.db.models.deletion.CASCADE, to='todo.list')),
],
),
migrations.CreateModel(
name='SharedList',
fields=[
('id', models.BigAutoField(auto_created=True,
primary_key=True, serialize=False, verbose_name='ID')),
('shared_list_id', models.CharField(max_length=200)),
('user', models.ForeignKey(blank=True, null=True,
on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
],
),
migrations.CreateModel(
name='ListTags',
fields=[
('id', models.BigAutoField(auto_created=True,
primary_key=True, serialize=False, verbose_name='ID')),
('tag_name', models.CharField(blank=True, max_length=50, null=True)),
('created_on', models.DateTimeField()),
('user_id', models.ForeignKey(blank=True, null=True,
on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
],
),
migrations.CreateModel(
name='ListItem',
fields=[
('id', models.BigAutoField(auto_created=True,
primary_key=True, serialize=False, verbose_name='ID')),
('item_name', models.CharField(blank=True, max_length=50, null=True)),
('item_text', models.CharField(max_length=100)),
('is_done', models.BooleanField(default=False)),
('created_on', models.DateTimeField()),
('finished_on', models.DateTimeField()),
('due_date', models.DateField()),
('tag_color', models.CharField(max_length=10)),
('list', models.ForeignKey(
on_delete=django.db.models.deletion.CASCADE, to='todo.list')),
],
),
]
Classes
class Migration (name, app_label)-
The base class for all migrations.
Migration files will import this from django.db.migrations.Migration and subclass it as a class called Migration. It will have one or more of the following attributes:
- operations: A list of Operation instances, probably from django.db.migrations.operations
- dependencies: A list of tuples of (app_path, migration_name)
- run_before: A list of tuples of (app_path, migration_name)
- replaces: A list of migration_names
Note that all migrations come out of migrations and into the Loader or Graph as instances, having been initialized with their app label and name.
Expand source code
class Migration(migrations.Migration): initial = True dependencies = [ migrations.swappable_dependency(settings.AUTH_USER_MODEL), ] operations = [ migrations.CreateModel( name='List', fields=[ ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('title_text', models.CharField(max_length=100)), ('created_on', models.DateTimeField()), ('updated_on', models.DateTimeField()), ('list_tag', models.CharField(default='none', max_length=50)), ('is_shared', models.BooleanField(default=False)), ('user_id', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)), ], ), migrations.CreateModel( name='Template', fields=[ ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('title_text', models.CharField(max_length=100)), ('created_on', models.DateTimeField()), ('updated_on', models.DateTimeField()), ('user_id', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)), ], ), migrations.CreateModel( name='TemplateItem', fields=[ ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('item_text', models.CharField(max_length=100)), ('created_on', models.DateTimeField()), ('finished_on', models.DateTimeField()), ('due_date', models.DateField()), ('tag_color', models.CharField(max_length=10)), ('template', models.ForeignKey( on_delete=django.db.models.deletion.CASCADE, to='todo.template')), ], ), migrations.CreateModel( name='SharedUsers', fields=[ ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('shared_user', models.CharField(max_length=200)), ('list_id', models.ForeignKey( on_delete=django.db.models.deletion.CASCADE, to='todo.list')), ], ), migrations.CreateModel( name='SharedList', fields=[ ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('shared_list_id', models.CharField(max_length=200)), ('user', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)), ], ), migrations.CreateModel( name='ListTags', fields=[ ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('tag_name', models.CharField(blank=True, max_length=50, null=True)), ('created_on', models.DateTimeField()), ('user_id', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)), ], ), migrations.CreateModel( name='ListItem', fields=[ ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('item_name', models.CharField(blank=True, max_length=50, null=True)), ('item_text', models.CharField(max_length=100)), ('is_done', models.BooleanField(default=False)), ('created_on', models.DateTimeField()), ('finished_on', models.DateTimeField()), ('due_date', models.DateField()), ('tag_color', models.CharField(max_length=10)), ('list', models.ForeignKey( on_delete=django.db.models.deletion.CASCADE, to='todo.list')), ], ), ]Ancestors
- django.db.migrations.migration.Migration
Class variables
var dependenciesvar initialvar operations