delete migrations

This commit is contained in:
sankalp committed 2025-03-29 09:16:49 +05:45
1 parent 17e7ed0818
commit 94ad0cadf2
3 files changed
-357

No files matched your search

-333
View File
@@ -1,333 +0,0 @@
# Generated by Django 5.1.7 on 2025-03-27 01:54
import django.contrib.auth.models
import django.db.models.deletion
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
('auth', '0012_alter_user_first_name_max_length'),
]
operations = [
migrations.CreateModel(
name='Batch',
fields=[
('id', models.BigAutoField(primary_key=True, serialize=False)),
('name', models.CharField(max_length=255)),
('start_date', models.DateField(blank=True, null=True)),
('end_date', models.DateField(blank=True, null=True)),
],
options={
'verbose_name': 'Batch',
'verbose_name_plural': 'Batches',
},
),
migrations.CreateModel(
name='Course',
fields=[
('id', models.BigAutoField(primary_key=True, serialize=False)),
('name', models.CharField(max_length=500)),
('duration', models.IntegerField(blank=True, default=1, null=True)),
('duration_type', models.CharField(blank=True, choices=[('Year', 'Yearl Based'), ('Semester', 'Semester Based')], max_length=255, null=True)),
],
options={
'verbose_name': 'Course',
'verbose_name_plural': 'Courses',
},
),
migrations.CreateModel(
name='FCMDevice',
fields=[
('id', models.BigAutoField(primary_key=True, serialize=False)),
('token', models.TextField(unique=True)),
],
),
migrations.CreateModel(
name='Institute',
fields=[
('id', models.BigAutoField(primary_key=True, serialize=False)),
('name', models.CharField(max_length=255)),
('phone', models.CharField(blank=True, max_length=255, null=True)),
('email', models.CharField(blank=True, max_length=255, null=True)),
('address', models.CharField(blank=True, max_length=255, null=True)),
('pan_no', models.CharField(blank=True, max_length=255, null=True)),
('reg_no', models.CharField(blank=True, max_length=255, null=True)),
('logo', models.ImageField(blank=True, null=True, upload_to='image')),
('description', models.TextField(blank=True, null=True)),
],
options={
'verbose_name': 'Institute',
'verbose_name_plural': 'Institutes',
},
),
migrations.CreateModel(
name='Notice',
fields=[
('id', models.BigAutoField(primary_key=True, serialize=False)),
('title', models.CharField(max_length=255)),
('image', models.ImageField(blank=True, null=True, upload_to='notice')),
('message', models.TextField(blank=True, null=True)),
('created_at', models.DateTimeField(auto_now_add=True)),
],
options={
'verbose_name': 'Notice',
'verbose_name_plural': 'Notices',
},
),
migrations.CreateModel(
name='Staff',
fields=[
('last_login', models.DateTimeField(blank=True, null=True, verbose_name='last login')),
('is_active', models.BooleanField(default=True)),
('is_superuser', models.BooleanField(default=False)),
('id', models.BigAutoField(primary_key=True, serialize=False)),
('name', models.CharField(max_length=255)),
('phone', models.CharField(blank=True, max_length=255, null=True, unique=True)),
('designation', models.CharField(blank=True, max_length=255, null=True)),
('gender', models.CharField(blank=True, choices=[('Male', 'Male'), ('Female', 'Female'), ('Other', 'Other')], max_length=255, null=True)),
('birth_date', models.DateField(blank=True, null=True)),
('email', models.CharField(blank=True, max_length=255, null=True)),
('temporary_address', models.CharField(blank=True, max_length=255, null=True)),
('permanent_address', models.CharField(blank=True, max_length=255, null=True)),
('marital_status', models.CharField(blank=True, choices=[('Married', 'Married'), ('Unmarried', 'Unmarried'), ('Divorced', 'Divorced')], max_length=255, null=True)),
('parent_name', models.CharField(blank=True, max_length=255, null=True)),
('parent_phone', models.CharField(blank=True, max_length=255, null=True)),
('citizenship_no', models.CharField(blank=True, max_length=255, null=True)),
('passport', models.CharField(blank=True, max_length=255, null=True)),
('image', models.ImageField(blank=True, null=True, upload_to='staff_image')),
('joining_date', models.DateField(blank=True, null=True)),
('password', models.CharField(editable=False, max_length=128, null=True)),
('groups', models.ManyToManyField(blank=True, help_text='The groups this staff belongs to.', related_name='staffs', to='auth.group', verbose_name='groups')),
('user_permissions', models.ManyToManyField(blank=True, help_text='Specific permissions for this staff.', related_name='staff_set', related_query_name='staff', to='auth.permission', verbose_name='user permissions')),
],
options={
'verbose_name': 'Staff',
'verbose_name_plural': 'Staffs',
},
managers=[
('objects', django.contrib.auth.models.UserManager()),
],
),
migrations.CreateModel(
name='Routine',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('start_time', models.TimeField()),
('end_time', models.TimeField()),
('semester_or_year', models.PositiveIntegerField()),
('is_active', models.BooleanField(default=True)),
('course', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='app.course')),
('teacher', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='app.staff')),
],
options={
'ordering': ['start_time'],
},
),
migrations.CreateModel(
name='Attendance',
fields=[
('id', models.BigAutoField(primary_key=True, serialize=False)),
('date', models.DateField()),
('teacher_attend', models.BooleanField(default=True)),
('class_status', models.BooleanField(default=True)),
('routine', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='attendances', to='app.routine')),
('teacher', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='attendances', to='app.staff')),
],
options={
'verbose_name': 'Attendance',
'verbose_name_plural': 'Attendances',
},
),
migrations.CreateModel(
name='Staff_leave',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('date', models.DateField()),
('message', models.TextField()),
('status', models.IntegerField(choices=[(0, 'Pending'), (1, 'Approved'), (2, 'Rejected')], default=0)),
('created_at', models.DateTimeField(auto_now_add=True)),
('updated_at', models.DateTimeField(auto_now=True)),
('staff', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='app.staff')),
],
options={
'verbose_name': 'Staff Leave',
'verbose_name_plural': 'Staff Leaves',
'ordering': ['-created_at'],
},
),
migrations.CreateModel(
name='Student',
fields=[
('last_login', models.DateTimeField(blank=True, null=True, verbose_name='last login')),
('is_active', models.BooleanField(default=True, help_text='Designates whether this user should be treated as active. Unselect this instead of deleting accounts.', verbose_name='active')),
('id', models.BigAutoField(primary_key=True, serialize=False)),
('name', models.CharField(max_length=255)),
('status', models.CharField(blank=True, choices=[('Active', 'Active'), ('Leave', 'Leave'), ('Completed', 'Completed')], max_length=255, null=True)),
('gender', models.CharField(blank=True, choices=[('Male', 'Male'), ('Female', 'Female'), ('Other', 'Other')], max_length=255, null=True)),
('birth_date', models.DateField(blank=True, null=True)),
('email', models.CharField(blank=True, max_length=255, null=True)),
('phone', models.CharField(blank=True, max_length=255, null=True, unique=True)),
('temporary_address', models.CharField(blank=True, max_length=500, null=True)),
('permanent_address', models.CharField(blank=True, max_length=500, null=True)),
('marital_status', models.CharField(blank=True, choices=[('Married', 'Married'), ('Unmarried', 'Unmarried'), ('Divorced', 'Divorced')], max_length=255, null=True)),
('parent_name', models.CharField(blank=True, max_length=255, null=True)),
('parent_phone', models.CharField(blank=True, max_length=255, null=True)),
('citizenship_no', models.CharField(blank=True, max_length=255, null=True)),
('image', models.ImageField(blank=True, null=True, upload_to='student_image')),
('current_semester', models.PositiveIntegerField(default=1, help_text='Current semester for semester-based courses')),
('joining_date', models.DateField(blank=True, null=True)),
('password', models.CharField(editable=False, max_length=128, null=True)),
('batches', models.ManyToManyField(blank=True, related_name='students', to='app.batch')),
('course', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='students', to='app.course')),
('groups', models.ManyToManyField(blank=True, help_text='The groups this student belongs to.', related_name='students', to='auth.group', verbose_name='groups')),
('user_permissions', models.ManyToManyField(blank=True, help_text='Specific permissions for this student.', related_name='student_set', related_query_name='student', to='auth.permission', verbose_name='user permissions')),
],
options={
'verbose_name': 'Student',
'verbose_name_plural': 'Students',
},
managers=[
('objects', django.contrib.auth.models.UserManager()),
],
),
migrations.CreateModel(
name='AttendanceRecord',
fields=[
('id', models.BigAutoField(primary_key=True, serialize=False)),
('student_attend', models.BooleanField(default=False)),
('attendance', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='records', to='app.attendance')),
('student', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='attendance_records', to='app.student')),
],
),
migrations.CreateModel(
name='Student_Leave',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('date', models.DateField()),
('message', models.TextField()),
('status', models.IntegerField(choices=[(0, 'Pending'), (1, 'Approved'), (2, 'Rejected')], default=0)),
('created_at', models.DateTimeField(auto_now_add=True)),
('updated_at', models.DateTimeField(auto_now=True)),
('student', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='app.student')),
],
options={
'verbose_name': 'Student Leave',
'verbose_name_plural': 'Student Leaves',
'ordering': ['-created_at'],
},
),
migrations.CreateModel(
name='Subject',
fields=[
('id', models.AutoField(primary_key=True, serialize=False)),
('name', models.CharField(max_length=255)),
('semester_or_year', models.PositiveIntegerField()),
('syllabus_pdf', models.FileField(blank=True, help_text='Upload syllabus or study material PDF', null=True, upload_to='subject_pdfs/')),
('course', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='app.course')),
],
options={
'ordering': ['course', 'semester_or_year', 'name'],
'unique_together': {('name', 'course', 'semester_or_year')},
},
),
migrations.AddField(
model_name='routine',
name='subject',
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='app.subject'),
),
migrations.CreateModel(
name='StaffInstituteFeedback',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('feedback_type', models.CharField(choices=[('General', 'General'), ('Facilities', 'Facilities'), ('Teaching', 'Teaching'), ('Infrastructure', 'Infrastructure'), ('Administration', 'Administration')], default='General', max_length=20)),
('rating', models.DecimalField(choices=[(1.0, 1.0), (1.5, 1.5), (2.0, 2.0), (2.5, 2.5), (3.0, 3.0), (3.5, 3.5), (4.0, 4.0), (4.5, 4.5), (5.0, 5.0)], decimal_places=1, max_digits=2)),
('feedback_text', models.TextField()),
('is_anonymous', models.BooleanField(default=False)),
('is_public', models.BooleanField(default=True)),
('created_at', models.DateTimeField(auto_now_add=True)),
('updated_at', models.DateTimeField(auto_now=True)),
('institute', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='staff_feedbacks', to='app.institute')),
('staff', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='institute_feedbacks', to='app.staff')),
],
options={
'verbose_name': 'Staff Institute Feedback',
'verbose_name_plural': 'Staff Institute Feedbacks',
'ordering': ['-created_at'],
'unique_together': {('staff', 'institute', 'feedback_type')},
},
),
migrations.CreateModel(
name='InstituteFeedback',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('feedback_type', models.CharField(choices=[('General', 'General'), ('Facilities', 'Facilities'), ('Teaching', 'Teaching'), ('Infrastructure', 'Infrastructure'), ('Administration', 'Administration')], default='General', max_length=20)),
('rating', models.DecimalField(choices=[(1.0, 1.0), (1.5, 1.5), (2.0, 2.0), (2.5, 2.5), (3.0, 3.0), (3.5, 3.5), (4.0, 4.0), (4.5, 4.5), (5.0, 5.0)], decimal_places=1, max_digits=2)),
('feedback_text', models.TextField()),
('is_anonymous', models.BooleanField(default=False)),
('is_public', models.BooleanField(default=True)),
('created_at', models.DateTimeField(auto_now_add=True)),
('updated_at', models.DateTimeField(auto_now=True)),
('institute', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='feedbacks', to='app.institute')),
('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='institute_feedbacks', to='app.student')),
],
options={
'verbose_name': 'Student Institute Feedback',
'verbose_name_plural': 'Student Institute Feedbacks',
'ordering': ['-created_at'],
'unique_together': {('user', 'institute', 'feedback_type')},
},
),
migrations.CreateModel(
name='CourseTracking',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('enrollment_date', models.DateField(auto_now_add=True)),
('start_date', models.DateField(blank=True, null=True)),
('expected_end_date', models.DateField(blank=True, null=True)),
('actual_end_date', models.DateField(blank=True, null=True)),
('progress_status', models.CharField(choices=[('Not Started', 'Not Started'), ('In Progress', 'In Progress'), ('Completed', 'Completed'), ('Dropped', 'Dropped')], default='Not Started', max_length=20)),
('completion_percentage', models.IntegerField(default=0, help_text='Percentage of course completion (0-100)')),
('current_semester', models.PositiveIntegerField(default=1)),
('semester_start_date', models.DateField(blank=True, null=True)),
('semester_end_date', models.DateField(blank=True, null=True)),
('notes', models.TextField(blank=True, null=True)),
('created_at', models.DateTimeField(auto_now_add=True)),
('updated_at', models.DateTimeField(auto_now=True)),
('course', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='student_trackings', to='app.course')),
('student', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='course_trackings', to='app.student')),
],
options={
'verbose_name': 'Course Tracking',
'verbose_name_plural': 'Course Trackings',
'ordering': ['-created_at'],
'unique_together': {('student', 'course')},
},
),
migrations.CreateModel(
name='StudentFeedback',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('rating', models.DecimalField(choices=[(1.0, 1.0), (1.5, 1.5), (2.0, 2.0), (2.5, 2.5), (3.0, 3.0), (3.5, 3.5), (4.0, 4.0), (4.5, 4.5), (5.0, 5.0)], decimal_places=1, max_digits=2)),
('feedback_text', models.TextField()),
('created_at', models.DateTimeField(auto_now_add=True)),
('updated_at', models.DateTimeField(auto_now=True)),
('student', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='feedbacks', to='app.student')),
('teacher', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='feedbacks', to='app.staff')),
],
options={
'verbose_name': 'Student Feedback',
'verbose_name_plural': 'Student Feedbacks',
'ordering': ['-created_at'],
'unique_together': {('student', 'teacher')},
},
),
migrations.AlterUniqueTogether(
name='routine',
unique_together={('course', 'subject', 'teacher', 'start_time', 'end_time', 'semester_or_year')},
),
]
@@ -1,24 +0,0 @@
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('app', '0001_initial'),
]
operations = [
migrations.RunSQL(
"""
CREATE TABLE IF NOT EXISTS "app_staffinstitutefeedback" (
"id" integer NOT NULL PRIMARY KEY AUTOINCREMENT,
"feedback_type" integer NOT NULL,
"feedback_text" text NOT NULL,
"rating" integer NOT NULL,
"is_anonymous" bool NOT NULL,
"created_at" datetime NOT NULL,
"staff_id" integer NOT NULL REFERENCES "app_staff" ("id") DEFERRABLE INITIALLY DEFERRED
);
""",
"DROP TABLE IF EXISTS app_staffinstitutefeedback;"
),
]
View File
Whitespace-only changes.