Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added all missing django migrations files and undone gitignore rules … #31

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ coverage.xml
# Django stuff:
*.log
local_settings.py
*/*/dj*/*/migrations/0*.py

# Flask stuff:
instance/
Expand Down Expand Up @@ -133,7 +132,6 @@ backend/static
backend/.env
#backend/djcore

**/migrations/*.py
/docker/basemap/data/
/docker/basemap/gebco/
/proxy/node_modules/
Expand Down
38 changes: 38 additions & 0 deletions backend/djcore/djcore/users/migrations/0001_initial.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# Generated by Django 3.0.6 on 2024-02-20 17:06

from django.db import migrations, models
import django.utils.timezone
import uuid


class Migration(migrations.Migration):

initial = True

dependencies = [
('auth', '0011_update_proxy_permissions'),
]

operations = [
migrations.CreateModel(
name='User',
fields=[
('password', models.CharField(max_length=128, verbose_name='password')),
('last_login', models.DateTimeField(blank=True, null=True, verbose_name='last login')),
('is_superuser', models.BooleanField(default=False, help_text='Designates that this user has all permissions without explicitly assigning them.', verbose_name='superuser status')),
('first_name', models.CharField(blank=True, max_length=30, verbose_name='first name')),
('last_name', models.CharField(blank=True, max_length=150, verbose_name='last name')),
('is_staff', models.BooleanField(default=False, help_text='Designates whether the user can log into this admin site.', verbose_name='staff status')),
('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')),
('date_joined', models.DateTimeField(default=django.utils.timezone.now, verbose_name='date joined')),
('id', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)),
('email', models.EmailField(max_length=254, unique=True, verbose_name='email address')),
('username', models.CharField(blank=True, max_length=150, null=True, verbose_name='username')),
('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={
'permissions': (('option_list_user', 'Can list user'),),
},
),
]
Empty file.
105 changes: 105 additions & 0 deletions backend/padoa/forecastattributes/migrations/0001_initial.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
# Generated by Django 3.0.6 on 2024-02-07 16:03

from django.db import migrations, models


class Migration(migrations.Migration):

initial = True

dependencies = [
]

operations = [
migrations.CreateModel(
name='DataSeries',
fields=[
('id', models.CharField(editable=False, max_length=255, primary_key=True, serialize=False)),
('name', models.CharField(max_length=255, unique=True)),
('description', models.CharField(blank=True, max_length=255, null=True)),
('order_item', models.IntegerField(default=0)),
],
options={
'ordering': ['order_item'],
'abstract': False,
},
),
migrations.CreateModel(
name='ForecastModel',
fields=[
('id', models.CharField(editable=False, max_length=255, primary_key=True, serialize=False)),
('name', models.CharField(max_length=255, unique=True)),
('description', models.CharField(blank=True, max_length=255, null=True)),
('order_item', models.IntegerField(default=0)),
],
options={
'ordering': ['order_item'],
'abstract': False,
},
),
migrations.CreateModel(
name='Scenario',
fields=[
('id', models.CharField(editable=False, max_length=255, primary_key=True, serialize=False)),
('name', models.CharField(max_length=255, unique=True)),
('description', models.CharField(blank=True, max_length=255, null=True)),
('order_item', models.IntegerField(default=0)),
],
options={
'ordering': ['order_item'],
'abstract': False,
},
),
migrations.CreateModel(
name='TimeWindow',
fields=[
('id', models.CharField(editable=False, max_length=255, primary_key=True, serialize=False)),
('name', models.CharField(max_length=255, unique=True)),
('description', models.CharField(blank=True, max_length=255, null=True)),
('order_item', models.IntegerField(default=0)),
],
options={
'ordering': ['order_item'],
'abstract': False,
},
),
migrations.CreateModel(
name='ValueType',
fields=[
('id', models.CharField(editable=False, max_length=255, primary_key=True, serialize=False)),
('name', models.CharField(max_length=255, unique=True)),
('description', models.CharField(blank=True, max_length=255, null=True)),
('order_item', models.IntegerField(default=0)),
],
options={
'ordering': ['order_item'],
'abstract': False,
},
),
migrations.CreateModel(
name='Variable',
fields=[
('id', models.CharField(editable=False, max_length=255, primary_key=True, serialize=False)),
('name', models.CharField(max_length=255, unique=True)),
('description', models.CharField(blank=True, max_length=255, null=True)),
('order_item', models.IntegerField(default=0)),
],
options={
'ordering': ['order_item'],
'abstract': False,
},
),
migrations.CreateModel(
name='YearPeriod',
fields=[
('id', models.CharField(editable=False, max_length=255, primary_key=True, serialize=False)),
('name', models.CharField(max_length=255, unique=True)),
('description', models.CharField(blank=True, max_length=255, null=True)),
('order_item', models.IntegerField(default=0)),
],
options={
'ordering': ['order_item'],
'abstract': False,
},
),
]
Empty file.
50 changes: 50 additions & 0 deletions backend/padoa/places/migrations/0001_initial.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# Generated by Django 3.0.6 on 2024-02-07 16:04

import django.contrib.gis.db.models.fields
from django.db import migrations, models
import django.db.models.deletion


class Migration(migrations.Migration):

initial = True

dependencies = [
]

operations = [
migrations.CreateModel(
name='Regions',
fields=[
('id', models.IntegerField(editable=False, primary_key=True, serialize=False)),
('name', models.CharField(blank=True, max_length=190, null=True)),
('geometry', django.contrib.gis.db.models.fields.MultiPolygonField(db_index=True, srid=4326)),
('centroid', django.contrib.gis.db.models.fields.PointField(db_index=True, srid=4326)),
],
),
migrations.CreateModel(
name='Provinces',
fields=[
('id', models.IntegerField(editable=False, primary_key=True, serialize=False)),
('name', models.CharField(blank=True, max_length=190, null=True)),
('geometry', django.contrib.gis.db.models.fields.MultiPolygonField(db_index=True, srid=4326)),
('centroid', django.contrib.gis.db.models.fields.PointField(db_index=True, srid=4326)),
('region', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='province_regions', to='places.Regions')),
],
),
migrations.CreateModel(
name='Cities',
fields=[
('id', models.IntegerField(editable=False, primary_key=True, serialize=False)),
('name', models.CharField(blank=True, max_length=190, null=True)),
('prov_code', models.CharField(blank=True, max_length=190, null=True)),
('geometry', django.contrib.gis.db.models.fields.MultiPolygonField(db_index=True, srid=4326)),
('centroid', django.contrib.gis.db.models.fields.PointField(db_index=True, srid=4326)),
('province', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='province', to='places.Provinces')),
('region', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='city_regions', to='places.Regions')),
],
options={
'verbose_name_plural': 'cities',
},
),
]
Empty file.
2 changes: 0 additions & 2 deletions backend/padoa/thredds/management/commands/import_setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ class Command(BaseCommand):
help = "This will import all importable things"

def handle(self, *args, **options):
call_command('makemigrations')
call_command('migrate')
# call_command('import_client')
call_command('import_super_user')
# call_command('load_groups_and_permissions')
Expand Down
55 changes: 55 additions & 0 deletions backend/padoa/thredds/migrations/0001_initial.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# Generated by Django 3.0.6 on 2024-02-07 16:03

import django.contrib.gis.db.models.fields
from django.db import migrations, models
import django.db.models.deletion


class Migration(migrations.Migration):

initial = True

dependencies = [
('forecastattributes', '__first__'),
]

operations = [
migrations.CreateModel(
name='UserDownload',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('public', models.BooleanField(default=False)),
('membership', models.CharField(blank=True, max_length=255, null=True)),
('reason', models.CharField(blank=True, max_length=255, null=True)),
('place', models.CharField(blank=True, max_length=255, null=True)),
('accept_disclaimer', models.BooleanField(default=False)),
('date', models.DateTimeField(auto_now_add=True)),
('parameters', models.TextField(default='', max_length=2000)),
],
),
migrations.CreateModel(
name='Map',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('time_start', models.DateTimeField(blank=True, null=True)),
('time_end', models.DateTimeField(blank=True, null=True)),
('time_interval', models.CharField(blank=True, max_length=255, null=True)),
('csr', models.CharField(blank=True, default='CRS:84', max_length=255, null=True)),
('spatialbounds', django.contrib.gis.db.models.fields.PolygonField(blank=True, null=True, srid=4326)),
('layer_id', models.CharField(max_length=255)),
('path', models.CharField(max_length=400)),
('elevation', models.IntegerField(blank=True, null=True)),
('palette', models.CharField(blank=True, max_length=255, null=True)),
('unit', models.CharField(blank=True, max_length=255, null=True)),
('color_scale_min', models.IntegerField(blank=True, null=True)),
('color_scale_max', models.IntegerField(blank=True, null=True)),
('data_series', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='forecastattributes.DataSeries')),
('forecast_model', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='forecastattributes.ForecastModel')),
('scenario', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='forecastattributes.Scenario')),
('time_window', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to='forecastattributes.TimeWindow')),
('value_type', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='forecastattributes.ValueType')),
('variable', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='forecastattributes.Variable')),
('year_period', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='forecastattributes.YearPeriod')),
],
),
]
Empty file.
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ services:
backend:
env_file: .env
container_name: backend.api
image: "ghcr.io/geobeyond/arpav_ppcv_backend:${CURRENT_GIT_BRANCH:-latest}"
image: "ghcr.io/geobeyond/arpav-ppcv-backend/arpav-ppcv-backend:${CURRENT_GIT_BRANCH:-latest}"
restart: unless-stopped
environment:
GUNICORN_WORKERS: 15
Expand Down
10 changes: 0 additions & 10 deletions tests/ci/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,16 +147,6 @@ async def _run_tests(
.with_env_variable("THREDDS_PASSWORD", env_variables["THREDDS_PASSWORD"])
.with_env_variable("THREDDS_USER", env_variables["THREDDS_USER"])
.with_exec(shlex.split("poetry install --with dev"))
.with_exec(
shlex.split(
"poetry run django-admin makemigrations "
"users "
"groups "
"forecastattributes "
"places "
"thredds"
)
)
.with_exec(shlex.split("poetry run django-admin migrate"))
.with_exec(
shlex.split(
Expand Down