Skip to content

Commit

Permalink
Post , like migration
Browse files Browse the repository at this point in the history
  • Loading branch information
ZEZE1020 committed Jan 13, 2025
1 parent 73a4985 commit f0ccb61
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions accounts/migrations/0002_post_like.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Generated by Django 5.1.4 on 2025-01-13 01:09

import django.db.models.deletion
from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('accounts', '0001_initial'),
]

operations = [
migrations.CreateModel(
name='Post',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('content', models.TextField()),
('created_at', models.DateTimeField(auto_now_add=True)),
('likes', models.ManyToManyField(blank=True, related_name='liked_posts', to='accounts.customuser')),
('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='accounts.customuser')),
],
),
migrations.CreateModel(
name='Like',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('created_at', models.DateTimeField(auto_now_add=True)),
('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='accounts.customuser')),
('post', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='accounts.post')),
],
),
]

0 comments on commit f0ccb61

Please sign in to comment.