* Adding the base of our API * Little file and lint adjustments * Adding the lint command to Makefile * Adding the Minesweeper logic for game creation * Adding some tests for the Minesweeper algorithm * Adding some tools command to Makefile like pre-commit and pip-tools * Adding test help text to Makefile * all new user is_staff=True, for development for now * Now we can get the data from specific game Adding game status Adding game status Fixing game models
66 lines
1.9 KiB
Python
66 lines
1.9 KiB
Python
# Generated by Django 3.1.3 on 2020-11-05 03:03
|
|
|
|
from django.db import migrations, models
|
|
import django_mysql.models
|
|
import internal.utils
|
|
|
|
|
|
class Migration(migrations.Migration):
|
|
|
|
initial = True
|
|
|
|
dependencies = []
|
|
|
|
operations = [
|
|
migrations.CreateModel(
|
|
name="Game",
|
|
fields=[
|
|
(
|
|
"id",
|
|
models.AutoField(
|
|
auto_created=True,
|
|
primary_key=True,
|
|
serialize=False,
|
|
verbose_name="ID",
|
|
),
|
|
),
|
|
(
|
|
"created_at",
|
|
models.DateTimeField(
|
|
auto_now_add=True, verbose_name="Creation date"
|
|
),
|
|
),
|
|
(
|
|
"modified_at",
|
|
models.DateTimeField(auto_now=True, verbose_name="Last update"),
|
|
),
|
|
(
|
|
"rows",
|
|
models.PositiveIntegerField(default=10, verbose_name="Board rows"),
|
|
),
|
|
(
|
|
"cols",
|
|
models.PositiveIntegerField(default=10, verbose_name="Board cols"),
|
|
),
|
|
(
|
|
"mines",
|
|
models.PositiveIntegerField(
|
|
default=5, verbose_name="Mines on board"
|
|
),
|
|
),
|
|
(
|
|
"board",
|
|
django_mysql.models.JSONField(
|
|
default=internal.utils.empty_list,
|
|
verbose_name="Generated board",
|
|
),
|
|
),
|
|
],
|
|
options={
|
|
"verbose_name": "Game",
|
|
"verbose_name_plural": "Games",
|
|
"db_table": "games",
|
|
},
|
|
),
|
|
]
|