Skip to content

Commit

Permalink
build: add migrations
Browse files Browse the repository at this point in the history
  • Loading branch information
alexmudrak committed Dec 8, 2023
1 parent 8f6d645 commit 0a61bb0
Show file tree
Hide file tree
Showing 15 changed files with 903 additions and 2 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
<hr />

<p align="center">
<a href="https://github.com/alexmudrak/webmaster-helper-dev/actions/workflows/ci-backend.yaml" target="_blank">
<img src="https://github.com/alexmudrak/webmaster-helper-dev/actions/workflows/ci-backend.yaml/badge.svg?branch=main" alt="Test">
<a href="https://github.com/alexmudrak/webmaster-helper/actions/workflows/ci-backend.yaml" target="_blank">
<img src="https://github.com/alexmudrak/webmaster-helper/actions/workflows/ci-backend.yaml/badge.svg?branch=master" alt="CI Status">
</a>
</p>

Expand Down
67 changes: 67 additions & 0 deletions src/api/project/migrations/0001_initial.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
# Generated by Django 4.2.7 on 2023-12-08 09:41

import uuid

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


class Migration(migrations.Migration):
initial = True

dependencies = [
("url", "__first__"),
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]

operations = [
migrations.CreateModel(
name="Project",
fields=[
(
"id",
models.BigAutoField(
auto_created=True,
primary_key=True,
serialize=False,
verbose_name="ID",
),
),
(
"public_id",
models.UUIDField(
db_index=True,
default=uuid.uuid4,
editable=False,
unique=True,
),
),
("created", models.DateTimeField(auto_now_add=True)),
("updated", models.DateTimeField(auto_now=True)),
("name", models.CharField(max_length=255)),
("description", models.TextField(blank=True)),
(
"owner",
models.ForeignKey(
null=True,
on_delete=django.db.models.deletion.CASCADE,
to=settings.AUTH_USER_MODEL,
),
),
(
"url",
models.ForeignKey(
null=True,
on_delete=django.db.models.deletion.SET_NULL,
related_name="project_url",
to="url.url",
),
),
],
options={
"db_table": "projects",
"unique_together": {("url", "owner")},
},
),
]
Empty file.
49 changes: 49 additions & 0 deletions src/api/url/migrations/0001_initial.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# Generated by Django 4.2.7 on 2023-12-08 09:41

import uuid

from django.db import migrations, models


class Migration(migrations.Migration):
initial = True

dependencies: list = []

operations = [
migrations.CreateModel(
name="Url",
fields=[
(
"id",
models.BigAutoField(
auto_created=True,
primary_key=True,
serialize=False,
verbose_name="ID",
),
),
(
"public_id",
models.UUIDField(
db_index=True,
default=uuid.uuid4,
editable=False,
unique=True,
),
),
("created", models.DateTimeField(auto_now_add=True)),
("updated", models.DateTimeField(auto_now=True)),
("url", models.URLField(max_length=255, unique=True)),
(
"seo_status",
models.CharField(
default="DONE", max_length=255, null=True
),
),
],
options={
"db_table": "urls",
},
),
]
Empty file.
95 changes: 95 additions & 0 deletions src/api/user/migrations/0001_initial.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
# Generated by Django 4.2.7 on 2023-12-08 09:39

import uuid

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="User",
fields=[
(
"id",
models.BigAutoField(
auto_created=True,
primary_key=True,
serialize=False,
verbose_name="ID",
),
),
(
"password",
models.CharField(max_length=128, verbose_name="password"),
),
(
"last_login",
models.DateTimeField(
blank=True, null=True, verbose_name="last login"
),
),
(
"public_id",
models.UUIDField(
db_index=True,
default=uuid.uuid4,
editable=False,
unique=True,
),
),
("created", models.DateTimeField(auto_now_add=True)),
("updated", models.DateTimeField(auto_now=True)),
(
"username",
models.CharField(
db_index=True, max_length=255, unique=True
),
),
(
"email",
models.EmailField(
db_index=True, max_length=254, unique=True
),
),
("is_active", models.BooleanField(default=True)),
("is_staff", models.BooleanField(default=False)),
("is_superuser", models.BooleanField(default=False)),
(
"groups",
models.ManyToManyField(
blank=True,
help_text=(
"The groups this user belongs to. A user will get "
"all permissions granted to each of their groups."
),
related_name="user_set",
related_query_name="user",
to="auth.group",
verbose_name="groups",
),
),
(
"user_permissions",
models.ManyToManyField(
blank=True,
help_text="Specific permissions for this user.",
related_name="user_set",
related_query_name="user",
to="auth.permission",
verbose_name="user permissions",
),
),
],
options={
"db_table": "users",
"unique_together": {("username", "email")},
},
),
]
Empty file.
Loading

0 comments on commit 0a61bb0

Please sign in to comment.