Combined migrations
parent
00ad1f429f
commit
ab7bfb923c
|
@ -1,139 +0,0 @@
|
||||||
# Generated by Django 2.1.2 on 2019-05-12 16:15
|
|
||||||
|
|
||||||
import GeoffreyApp.util
|
|
||||||
from django.db import migrations, models
|
|
||||||
import django.db.models.deletion
|
|
||||||
|
|
||||||
|
|
||||||
class Migration(migrations.Migration):
|
|
||||||
|
|
||||||
initial = True
|
|
||||||
|
|
||||||
dependencies = [
|
|
||||||
]
|
|
||||||
|
|
||||||
operations = [
|
|
||||||
migrations.CreateModel(
|
|
||||||
name='APIToken',
|
|
||||||
fields=[
|
|
||||||
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
|
||||||
('key', models.CharField(default=GeoffreyApp.util.create_token, max_length=25, unique=True)),
|
|
||||||
('name', models.CharField(blank=True, max_length=50)),
|
|
||||||
('commands_perm', models.BooleanField(default=False)),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
migrations.CreateModel(
|
|
||||||
name='ItemListing',
|
|
||||||
fields=[
|
|
||||||
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
|
||||||
('item_name', models.CharField(max_length=128)),
|
|
||||||
('price', models.IntegerField()),
|
|
||||||
('amount', models.IntegerField()),
|
|
||||||
('date_restocked', models.DateTimeField(auto_now=True)),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
migrations.CreateModel(
|
|
||||||
name='Location',
|
|
||||||
fields=[
|
|
||||||
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
|
||||||
('name', models.CharField(max_length=128, unique=True)),
|
|
||||||
('x_coord', models.IntegerField()),
|
|
||||||
('z_coord', models.IntegerField()),
|
|
||||||
('dimension', models.CharField(choices=[('O', 'Overworld'), ('N', 'Nether'), ('E', 'The End')], max_length=1)),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
migrations.CreateModel(
|
|
||||||
name='Player',
|
|
||||||
fields=[
|
|
||||||
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
|
||||||
('name', models.CharField(max_length=30, unique=True)),
|
|
||||||
('mc_uuid', models.CharField(max_length=36, unique=True)),
|
|
||||||
('discord_uuid', models.CharField(max_length=50, unique=True)),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
migrations.CreateModel(
|
|
||||||
name='Resource',
|
|
||||||
fields=[
|
|
||||||
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
|
||||||
('resource_name', models.CharField(max_length=128)),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
migrations.CreateModel(
|
|
||||||
name='Tunnel',
|
|
||||||
fields=[
|
|
||||||
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
|
||||||
('tunnel_number', models.IntegerField()),
|
|
||||||
('tunnel_direction', models.CharField(choices=[('N', 'North'), ('E', 'East'), ('S', 'South'), ('W', 'West')], max_length=1)),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
migrations.CreateModel(
|
|
||||||
name='Attraction',
|
|
||||||
fields=[
|
|
||||||
('location_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='GeoffreyApp.Location')),
|
|
||||||
],
|
|
||||||
bases=('GeoffreyApp.location',),
|
|
||||||
),
|
|
||||||
migrations.CreateModel(
|
|
||||||
name='Base',
|
|
||||||
fields=[
|
|
||||||
('location_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='GeoffreyApp.Location')),
|
|
||||||
],
|
|
||||||
bases=('GeoffreyApp.location',),
|
|
||||||
),
|
|
||||||
migrations.CreateModel(
|
|
||||||
name='Market',
|
|
||||||
fields=[
|
|
||||||
('location_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='GeoffreyApp.Location')),
|
|
||||||
],
|
|
||||||
bases=('GeoffreyApp.location',),
|
|
||||||
),
|
|
||||||
migrations.CreateModel(
|
|
||||||
name='PointOfInterest',
|
|
||||||
fields=[
|
|
||||||
('location_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='GeoffreyApp.Location')),
|
|
||||||
],
|
|
||||||
bases=('GeoffreyApp.location',),
|
|
||||||
),
|
|
||||||
migrations.CreateModel(
|
|
||||||
name='PublicFarm',
|
|
||||||
fields=[
|
|
||||||
('location_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='GeoffreyApp.Location')),
|
|
||||||
],
|
|
||||||
bases=('GeoffreyApp.location',),
|
|
||||||
),
|
|
||||||
migrations.CreateModel(
|
|
||||||
name='Shop',
|
|
||||||
fields=[
|
|
||||||
('location_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='GeoffreyApp.Location')),
|
|
||||||
],
|
|
||||||
bases=('GeoffreyApp.location',),
|
|
||||||
),
|
|
||||||
migrations.CreateModel(
|
|
||||||
name='Town',
|
|
||||||
fields=[
|
|
||||||
('location_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='GeoffreyApp.Location')),
|
|
||||||
('residents', models.ManyToManyField(to='GeoffreyApp.Player')),
|
|
||||||
],
|
|
||||||
bases=('GeoffreyApp.location',),
|
|
||||||
),
|
|
||||||
migrations.AddField(
|
|
||||||
model_name='tunnel',
|
|
||||||
name='location',
|
|
||||||
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='tunnel_location', to='GeoffreyApp.Location'),
|
|
||||||
),
|
|
||||||
migrations.AddField(
|
|
||||||
model_name='location',
|
|
||||||
name='owner',
|
|
||||||
field=models.ManyToManyField(to='GeoffreyApp.Player'),
|
|
||||||
),
|
|
||||||
migrations.AddField(
|
|
||||||
model_name='resource',
|
|
||||||
name='farm',
|
|
||||||
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='resource', to='GeoffreyApp.PublicFarm'),
|
|
||||||
),
|
|
||||||
migrations.AddField(
|
|
||||||
model_name='itemlisting',
|
|
||||||
name='shop',
|
|
||||||
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='shop_selling', to='GeoffreyApp.Shop'),
|
|
||||||
),
|
|
||||||
]
|
|
|
@ -1,27 +0,0 @@
|
||||||
# Generated by Django 2.1.2 on 2018-12-29 22:16
|
|
||||||
|
|
||||||
from django.db import migrations, models
|
|
||||||
|
|
||||||
|
|
||||||
class Migration(migrations.Migration):
|
|
||||||
dependencies = [
|
|
||||||
('GeoffreyApp', '0001_initial'),
|
|
||||||
]
|
|
||||||
|
|
||||||
operations = [
|
|
||||||
migrations.AlterField(
|
|
||||||
model_name='player',
|
|
||||||
name='discord_uuid',
|
|
||||||
field=models.CharField(max_length=50, unique=True),
|
|
||||||
),
|
|
||||||
migrations.AlterField(
|
|
||||||
model_name='player',
|
|
||||||
name='mc_uuid',
|
|
||||||
field=models.CharField(max_length=36, unique=True),
|
|
||||||
),
|
|
||||||
migrations.AlterField(
|
|
||||||
model_name='player',
|
|
||||||
name='name',
|
|
||||||
field=models.CharField(max_length=30, unique=True),
|
|
||||||
),
|
|
||||||
]
|
|
|
@ -1,22 +0,0 @@
|
||||||
# Generated by Django 2.1.2 on 2018-12-29 22:28
|
|
||||||
|
|
||||||
import GeoffreyApp.util
|
|
||||||
from django.db import migrations, models
|
|
||||||
|
|
||||||
|
|
||||||
class Migration(migrations.Migration):
|
|
||||||
dependencies = [
|
|
||||||
('GeoffreyApp', '0002_auto_20181229_2216'),
|
|
||||||
]
|
|
||||||
|
|
||||||
operations = [
|
|
||||||
migrations.CreateModel(
|
|
||||||
name='APIToken',
|
|
||||||
fields=[
|
|
||||||
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
|
||||||
(
|
|
||||||
'key', models.CharField(default=GeoffreyApp.util.create_token, max_length=25, unique=True)),
|
|
||||||
('name', models.CharField(blank=True, max_length=50)),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
]
|
|
|
@ -1,17 +0,0 @@
|
||||||
# Generated by Django 2.1.2 on 2018-12-30 01:21
|
|
||||||
|
|
||||||
from django.db import migrations, models
|
|
||||||
|
|
||||||
|
|
||||||
class Migration(migrations.Migration):
|
|
||||||
dependencies = [
|
|
||||||
('GeoffreyApp', '0003_apitoken'),
|
|
||||||
]
|
|
||||||
|
|
||||||
operations = [
|
|
||||||
migrations.AddField(
|
|
||||||
model_name='apitoken',
|
|
||||||
name='commands_perm',
|
|
||||||
field=models.BooleanField(default=False),
|
|
||||||
),
|
|
||||||
]
|
|
|
@ -1,23 +0,0 @@
|
||||||
# Generated by Django 2.1.2 on 2019-01-13 22:55
|
|
||||||
|
|
||||||
from django.db import migrations, models
|
|
||||||
|
|
||||||
|
|
||||||
class Migration(migrations.Migration):
|
|
||||||
dependencies = [
|
|
||||||
('GeoffreyApp', '0004_apitoken_commands_perm'),
|
|
||||||
]
|
|
||||||
|
|
||||||
operations = [
|
|
||||||
migrations.AddField(
|
|
||||||
model_name='itemlisting',
|
|
||||||
name='date_restocked',
|
|
||||||
field=models.DateTimeField(auto_now=True),
|
|
||||||
),
|
|
||||||
migrations.AlterField(
|
|
||||||
model_name='tunnel',
|
|
||||||
name='tunnel_direction',
|
|
||||||
field=models.CharField(choices=[('N', 'North'), ('E', 'East'), ('S', 'South'), ('W', 'West')],
|
|
||||||
max_length=1),
|
|
||||||
),
|
|
||||||
]
|
|
|
@ -1,21 +0,0 @@
|
||||||
# Generated by Django 2.1.2 on 2019-01-31 18:22
|
|
||||||
|
|
||||||
from django.db import migrations, models
|
|
||||||
|
|
||||||
|
|
||||||
class Migration(migrations.Migration):
|
|
||||||
dependencies = [
|
|
||||||
('GeoffreyApp', '0005_auto_20190113_2255'),
|
|
||||||
]
|
|
||||||
|
|
||||||
operations = [
|
|
||||||
migrations.RemoveField(
|
|
||||||
model_name='location',
|
|
||||||
name='owner',
|
|
||||||
),
|
|
||||||
migrations.AddField(
|
|
||||||
model_name='location',
|
|
||||||
name='owner',
|
|
||||||
field=models.ManyToManyField(to='GeoffreyApp.Player'),
|
|
||||||
),
|
|
||||||
]
|
|
|
@ -1,23 +0,0 @@
|
||||||
# Generated by Django 2.1.2 on 2019-02-02 20:57
|
|
||||||
|
|
||||||
from django.db import migrations, models
|
|
||||||
import django.db.models.deletion
|
|
||||||
|
|
||||||
|
|
||||||
class Migration(migrations.Migration):
|
|
||||||
dependencies = [
|
|
||||||
('GeoffreyApp', '0006_auto_20190131_1822'),
|
|
||||||
]
|
|
||||||
|
|
||||||
operations = [
|
|
||||||
migrations.CreateModel(
|
|
||||||
name='Town',
|
|
||||||
fields=[
|
|
||||||
('location_ptr',
|
|
||||||
models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True,
|
|
||||||
primary_key=True, serialize=False, to='GeoffreyApp.Location')),
|
|
||||||
('residents', models.ManyToManyField(to='GeoffreyApp.Player')),
|
|
||||||
],
|
|
||||||
bases=('GeoffreyApp.location',),
|
|
||||||
),
|
|
||||||
]
|
|
|
@ -1,31 +0,0 @@
|
||||||
# Generated by Django 2.1.2 on 2019-03-01 20:28
|
|
||||||
|
|
||||||
from django.db import migrations, models
|
|
||||||
import django.db.models.deletion
|
|
||||||
|
|
||||||
|
|
||||||
class Migration(migrations.Migration):
|
|
||||||
dependencies = [
|
|
||||||
('GeoffreyApp', '0007_town'),
|
|
||||||
]
|
|
||||||
|
|
||||||
operations = [
|
|
||||||
migrations.CreateModel(
|
|
||||||
name='PublicFarm',
|
|
||||||
fields=[
|
|
||||||
('location_ptr',
|
|
||||||
models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True,
|
|
||||||
primary_key=True, serialize=False, to='GeoffreyApp.Location')),
|
|
||||||
],
|
|
||||||
bases=('GeoffreyApp.location',),
|
|
||||||
),
|
|
||||||
migrations.CreateModel(
|
|
||||||
name='Resource',
|
|
||||||
fields=[
|
|
||||||
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
|
||||||
('resource_name', models.CharField(max_length=128)),
|
|
||||||
('farm', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='resource',
|
|
||||||
to='GeoffreyApp.PublicFarm')),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
]
|
|
|
@ -1,22 +0,0 @@
|
||||||
# Generated by Django 2.1.2 on 2019-04-10 22:53
|
|
||||||
|
|
||||||
from django.db import migrations, models
|
|
||||||
import django.db.models.deletion
|
|
||||||
|
|
||||||
|
|
||||||
class Migration(migrations.Migration):
|
|
||||||
dependencies = [
|
|
||||||
('GeoffreyApp', '0008_publicfarm_resource'),
|
|
||||||
]
|
|
||||||
|
|
||||||
operations = [
|
|
||||||
migrations.CreateModel(
|
|
||||||
name='Market',
|
|
||||||
fields=[
|
|
||||||
('location_ptr',
|
|
||||||
models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True,
|
|
||||||
primary_key=True, serialize=False, to='GeoffreyApp.Location')),
|
|
||||||
],
|
|
||||||
bases=('GeoffreyApp.location',),
|
|
||||||
),
|
|
||||||
]
|
|
|
@ -1,22 +0,0 @@
|
||||||
# Generated by Django 2.1.2 on 2019-04-11 21:15
|
|
||||||
|
|
||||||
from django.db import migrations, models
|
|
||||||
import django.db.models.deletion
|
|
||||||
|
|
||||||
|
|
||||||
class Migration(migrations.Migration):
|
|
||||||
dependencies = [
|
|
||||||
('GeoffreyApp', '0009_market'),
|
|
||||||
]
|
|
||||||
|
|
||||||
operations = [
|
|
||||||
migrations.CreateModel(
|
|
||||||
name='PointOfInterest',
|
|
||||||
fields=[
|
|
||||||
('location_ptr',
|
|
||||||
models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True,
|
|
||||||
primary_key=True, serialize=False, to='GeoffreyApp.Location')),
|
|
||||||
],
|
|
||||||
bases=('GeoffreyApp.location',),
|
|
||||||
),
|
|
||||||
]
|
|
|
@ -1,20 +0,0 @@
|
||||||
from django.db import migrations, models
|
|
||||||
import django.db.models.deletion
|
|
||||||
|
|
||||||
|
|
||||||
class Migration(migrations.Migration):
|
|
||||||
dependencies = [
|
|
||||||
('GeoffreyApp', '0010_pointofinterest'),
|
|
||||||
]
|
|
||||||
|
|
||||||
operations = [
|
|
||||||
migrations.CreateModel(
|
|
||||||
name='Attraction',
|
|
||||||
fields=[
|
|
||||||
('location_ptr',
|
|
||||||
models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True,
|
|
||||||
primary_key=True, serialize=False, to='GeoffreyApp.Location')),
|
|
||||||
],
|
|
||||||
bases=('GeoffreyApp.location',),
|
|
||||||
),
|
|
||||||
]
|
|
|
@ -1,15 +1,8 @@
|
||||||
import string
|
from django.utils.crypto import get_random_string
|
||||||
import random
|
|
||||||
|
|
||||||
|
|
||||||
def create_token(length=25):
|
def create_token(length=25):
|
||||||
token = ''
|
return get_random_string(length=length)
|
||||||
|
|
||||||
for i in range(0, length):
|
|
||||||
d = random.choice(string.digits + string.ascii_lowercase)
|
|
||||||
token += d
|
|
||||||
|
|
||||||
return token
|
|
||||||
|
|
||||||
|
|
||||||
def objects_list_to_json(obj_list):
|
def objects_list_to_json(obj_list):
|
||||||
|
|
Loading…
Reference in New Issue