-
Notifications
You must be signed in to change notification settings - Fork 46
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix reo2 migrations for dev/stage/prod databases
to fix your local database: psql drop database reopt; create database reopt; \q python manage.py migrate
- Loading branch information
Nick Laws
committed
Jan 20, 2022
1 parent
1c29f5f
commit 1d5cba8
Showing
2 changed files
with
64 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
# Generated by Django 3.1.14 on 2022-01-20 16:43 | ||
|
||
import django.contrib.postgres.fields | ||
import django.core.validators | ||
from django.db import migrations, models | ||
import django.db.models.deletion | ||
import job.models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('job', '0001_initial'), | ||
] | ||
|
||
operations = [ | ||
migrations.CreateModel( | ||
name='ExistingBoilerInputs', | ||
fields=[ | ||
('meta', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, primary_key=True, related_name='ExistingBoilerInputs', serialize=False, to='job.apimeta')), | ||
('max_thermal_factor_on_peak_load', models.FloatField(blank=True, default=1.25, help_text='Factor on peak thermal load that the boiler can supply', validators=[django.core.validators.MinValueValidator(1.0), django.core.validators.MaxValueValidator(5.0)])), | ||
('production_type', models.TextField(blank=True, choices=[('hot_water', 'Hot Water'), ('steam', 'Steam')], default='hot_water', help_text='Boiler thermal production type, `hot_water` or `steam`.')), | ||
('efficiency', models.FloatField(blank=True, default=0, help_text='Existing boiler system efficiency - conversion of fuel to usable heating thermal energy. Default value depends on `production_type`. Provide non-zero value to over-ride default.')), | ||
], | ||
bases=(job.models.BaseModel, models.Model), | ||
), | ||
migrations.CreateModel( | ||
name='ExistingBoilerOutputs', | ||
fields=[ | ||
('meta', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, primary_key=True, related_name='ExistingBoilerOutputs', serialize=False, to='job.apimeta')), | ||
('year_one_fuel_consumption_mmbtu_per_hr', django.contrib.postgres.fields.ArrayField(base_field=models.FloatField(blank=True, null=True), blank=True, default=list, null=True, size=None)), | ||
('year_one_thermal_production_mmbtu_per_hr', django.contrib.postgres.fields.ArrayField(base_field=models.FloatField(blank=True, null=True), blank=True, default=list, null=True, size=None)), | ||
('year_one_thermal_to_load_mmbtu_per_hour', django.contrib.postgres.fields.ArrayField(base_field=models.FloatField(blank=True, null=True), blank=True, default=list, null=True, size=None)), | ||
('year_one_thermal_to_tes_mmbtu_per_hour', django.contrib.postgres.fields.ArrayField(base_field=models.FloatField(blank=True, null=True), blank=True, default=list, null=True, size=None)), | ||
('year_one_thermal_to_steamturbine_mmbtu_per_hour', django.contrib.postgres.fields.ArrayField(base_field=models.FloatField(blank=True, null=True), blank=True, default=list, null=True, size=None)), | ||
('year_one_fuel_consumption_mmbtu', models.FloatField(blank=True, null=True)), | ||
('year_one_thermal_production_mmbtu', models.FloatField(blank=True, null=True)), | ||
('year_one_emissions_lb_C02', models.FloatField(blank=True, null=True)), | ||
('year_one_emissions_bau_lb_C02', models.FloatField(blank=True, null=True)), | ||
('lifecycle_fuel_cost', models.FloatField(blank=True, null=True)), | ||
('year_one_fuel_cost', models.FloatField(blank=True, null=True)), | ||
], | ||
bases=(job.models.BaseModel, models.Model), | ||
), | ||
migrations.CreateModel( | ||
name='SpaceHeatingLoadInputs', | ||
fields=[ | ||
('meta', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, primary_key=True, related_name='SpaceHeatingLoadInputs', serialize=False, to='job.apimeta')), | ||
('annual_mmbtu', models.FloatField(blank=True, help_text="Annual electric chiller electric consumption, in mmbtu, used to scale simulated default boiler load profile for the site's climate zone. If no value is provided then the DoE Commercial Reference Building value is used.", null=True, validators=[django.core.validators.MinValueValidator(1), django.core.validators.MaxValueValidator(100000000.0)])), | ||
('monthly_mmbtu', django.contrib.postgres.fields.ArrayField(base_field=models.FloatField(blank=True, validators=[django.core.validators.MinValueValidator(0), django.core.validators.MaxValueValidator(100000000.0)]), blank=True, default=list, help_text="Monthly boiler energy consumption series (an array 12 entries long), in mmbtu, used to scale simulated default boiler load profile for the site's climate zone. If no values are provided then the DoE Commercial Reference Building values are used.", size=None)), | ||
('doe_reference_name', models.TextField(blank=True, choices=[('FastFoodRest', 'Fastfoodrest'), ('FullServiceRest', 'Fullservicerest'), ('Hospital', 'Hospital'), ('LargeHotel', 'Largehotel'), ('LargeOffice', 'Largeoffice'), ('MediumOffice', 'Mediumoffice'), ('MidriseApartment', 'Midriseapartment'), ('Outpatient', 'Outpatient'), ('PrimarySchool', 'Primaryschool'), ('RetailStore', 'Retailstore'), ('SecondarySchool', 'Secondaryschool'), ('SmallHotel', 'Smallhotel'), ('SmallOffice', 'Smalloffice'), ('StripMall', 'Stripmall'), ('Supermarket', 'Supermarket'), ('Warehouse', 'Warehouse'), ('FlatLoad', 'Flatload'), ('FlatLoad_24_5', 'Flatload 24 5'), ('FlatLoad_16_7', 'Flatload 16 7'), ('FlatLoad_16_5', 'Flatload 16 5'), ('FlatLoad_8_7', 'Flatload 8 7'), ('FlatLoad_8_5', 'Flatload 8 5')], help_text='Simulated load profile from DOE Commercial Reference Buildings. If no value is provided then the `doe_reference_name` from the `ElectricLoad` is used. https://energy.gov/eere/buildings/commercial-reference-buildings')), | ||
('fuel_loads_mmbtu_per_hour', django.contrib.postgres.fields.ArrayField(base_field=models.FloatField(blank=True), blank=True, default=list, help_text='Typical boiler fuel load for all hours in one year. Over-rides `doe_reference_name` and other values if provided.', size=None)), | ||
('blended_doe_reference_names', django.contrib.postgres.fields.ArrayField(base_field=models.TextField(blank=True, choices=[('FastFoodRest', 'Fastfoodrest'), ('FullServiceRest', 'Fullservicerest'), ('Hospital', 'Hospital'), ('LargeHotel', 'Largehotel'), ('LargeOffice', 'Largeoffice'), ('MediumOffice', 'Mediumoffice'), ('MidriseApartment', 'Midriseapartment'), ('Outpatient', 'Outpatient'), ('PrimarySchool', 'Primaryschool'), ('RetailStore', 'Retailstore'), ('SecondarySchool', 'Secondaryschool'), ('SmallHotel', 'Smallhotel'), ('SmallOffice', 'Smalloffice'), ('StripMall', 'Stripmall'), ('Supermarket', 'Supermarket'), ('Warehouse', 'Warehouse'), ('FlatLoad', 'Flatload'), ('FlatLoad_24_5', 'Flatload 24 5'), ('FlatLoad_16_7', 'Flatload 16 7'), ('FlatLoad_16_5', 'Flatload 16 5'), ('FlatLoad_8_7', 'Flatload 8 7'), ('FlatLoad_8_5', 'Flatload 8 5')]), blank=True, default=list, help_text='Used in concert with blended_doe_reference_percents to create a blended load profile from multiple DoE Commercial Reference Buildings.', size=None)), | ||
('blended_doe_reference_percents', django.contrib.postgres.fields.ArrayField(base_field=models.FloatField(blank=True, null=True, validators=[django.core.validators.MinValueValidator(0), django.core.validators.MaxValueValidator(1.0)]), blank=True, default=list, help_text='Used in concert with blended_doe_reference_names to create a blended load profile from multiple DoE Commercial Reference Buildings. Must sum to 1.0.', size=None)), | ||
], | ||
bases=(job.models.BaseModel, models.Model), | ||
), | ||
migrations.AddField( | ||
model_name='financialoutputs', | ||
name='lifecycle_fuel_costs_after_tax', | ||
field=models.FloatField(blank=True, help_text="Net present fuel costs for all fuel burning technologies after tax (using offtaker's tax rate).", null=True), | ||
), | ||
] |