feat(migrations): Add initial GameServer model
This commit introduces the initial migration for the GameServer model within the coffee machine project, laying the groundwork for future development and data modeling. The model includes essential fields such as name, game, status (with predefined choices), installation path, and an optional field for custom script content. This foundational step is crucial for setting up the database structure needed to manage game server instances effectively, allowing for better organization, tracking, and manipulation of server data as the project evolves. The decision to include a status field with predefined choices enhances data integrity and facilitates the implementation of server management logic, paving the way for more efficient and error-resistant operations.
This commit is contained in:
parent
de8247e14e
commit
6778c2a2fb
1 changed files with 45 additions and 0 deletions
45
coffeemachine/servers/migrations/0001_initial.py
Normal file
45
coffeemachine/servers/migrations/0001_initial.py
Normal file
|
@ -0,0 +1,45 @@
|
|||
# Generated by Django 5.0.6 on 2024-06-05 14:51
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
initial = True
|
||||
|
||||
dependencies = []
|
||||
|
||||
operations = [
|
||||
migrations.CreateModel(
|
||||
name="GameServer",
|
||||
fields=[
|
||||
(
|
||||
"id",
|
||||
models.BigAutoField(
|
||||
auto_created=True,
|
||||
primary_key=True,
|
||||
serialize=False,
|
||||
verbose_name="ID",
|
||||
),
|
||||
),
|
||||
("name", models.CharField(max_length=100)),
|
||||
("game", models.CharField(max_length=100)),
|
||||
(
|
||||
"status",
|
||||
models.CharField(
|
||||
choices=[
|
||||
("stopped", "Stopped"),
|
||||
("running", "Running"),
|
||||
("installing", "Installing"),
|
||||
("updating", "Updating"),
|
||||
("error", "Error"),
|
||||
],
|
||||
default="stopped",
|
||||
max_length=100,
|
||||
),
|
||||
),
|
||||
("installation_path", models.CharField(max_length=255)),
|
||||
("custom_script_content", models.TextField(blank=True, null=True)),
|
||||
],
|
||||
),
|
||||
]
|
Loading…
Reference in a new issue