migrations
Authored by
mfwolffe <wolffemf@dukes.jmu.edu>
- SHA
277d93805ea23305eedd42bc33250ea3bc47b95c- Parents
-
f27ed92 - Tree
db8feaf
277d938
277d93805ea23305eedd42bc33250ea3bc47b95cf27ed92
db8feaf| Status | File | + | - |
|---|---|---|---|
| A |
backend/jubjub/jubjubword/migrations/0002_corpus_jubjubword_corpus.py
|
54 | 0 |
| A |
backend/jubjub/jubjubword/migrations/0003_remove_corpus_words_corpus_filename_and_more.py
|
36 | 0 |
backend/jubjub/jubjubword/migrations/0002_corpus_jubjubword_corpus.pyadded@@ -0,0 +1,54 @@ | ||
| 1 | +# Generated by Django 5.2.1 on 2025-07-25 14:11 | |
| 2 | + | |
| 3 | +import django.db.models.deletion | |
| 4 | +from django.db import migrations, models | |
| 5 | + | |
| 6 | + | |
| 7 | +class Migration(migrations.Migration): | |
| 8 | + | |
| 9 | + dependencies = [ | |
| 10 | + ("jubjubword", "0001_initial"), | |
| 11 | + ] | |
| 12 | + | |
| 13 | + operations = [ | |
| 14 | + migrations.CreateModel( | |
| 15 | + name="Corpus", | |
| 16 | + fields=[ | |
| 17 | + ( | |
| 18 | + "id", | |
| 19 | + models.BigAutoField( | |
| 20 | + auto_created=True, | |
| 21 | + primary_key=True, | |
| 22 | + serialize=False, | |
| 23 | + verbose_name="ID", | |
| 24 | + ), | |
| 25 | + ), | |
| 26 | + ("name", models.CharField(max_length=100, unique=True)), | |
| 27 | + ("slug", models.SlugField(unique=True)), | |
| 28 | + ("description", models.TextField()), | |
| 29 | + ("theme_color", models.CharField(default="#3A2449", max_length=7)), | |
| 30 | + ("icon_emoji", models.CharField(default="🦜", max_length=10)), | |
| 31 | + ("words", models.TextField(help_text="One word per line")), | |
| 32 | + ("word_count", models.IntegerField(default=0, editable=False)), | |
| 33 | + ("times_used", models.IntegerField(default=0)), | |
| 34 | + ("created_at", models.DateTimeField(auto_now_add=True)), | |
| 35 | + ("is_active", models.BooleanField(default=True)), | |
| 36 | + ("is_premium", models.BooleanField(default=False)), | |
| 37 | + ], | |
| 38 | + options={ | |
| 39 | + "verbose_name_plural": "Corpora", | |
| 40 | + "ordering": ["name"], | |
| 41 | + }, | |
| 42 | + ), | |
| 43 | + migrations.AddField( | |
| 44 | + model_name="jubjubword", | |
| 45 | + name="corpus", | |
| 46 | + field=models.ForeignKey( | |
| 47 | + blank=True, | |
| 48 | + null=True, | |
| 49 | + on_delete=django.db.models.deletion.SET_NULL, | |
| 50 | + related_name="generated_words", | |
| 51 | + to="jubjubword.corpus", | |
| 52 | + ), | |
| 53 | + ), | |
| 54 | + ] | |
backend/jubjub/jubjubword/migrations/0003_remove_corpus_words_corpus_filename_and_more.pyadded@@ -0,0 +1,36 @@ | ||
| 1 | +# Generated by Django 5.2.1 on 2025-07-25 16:44 | |
| 2 | + | |
| 3 | +from django.db import migrations, models | |
| 4 | + | |
| 5 | + | |
| 6 | +class Migration(migrations.Migration): | |
| 7 | + | |
| 8 | + dependencies = [ | |
| 9 | + ("jubjubword", "0002_corpus_jubjubword_corpus"), | |
| 10 | + ] | |
| 11 | + | |
| 12 | + operations = [ | |
| 13 | + migrations.RemoveField( | |
| 14 | + model_name="corpus", | |
| 15 | + name="words", | |
| 16 | + ), | |
| 17 | + migrations.AddField( | |
| 18 | + model_name="corpus", | |
| 19 | + name="filename", | |
| 20 | + field=models.CharField( | |
| 21 | + default="corpus.txt", | |
| 22 | + help_text="Filename in jubjubword directory", | |
| 23 | + max_length=100, | |
| 24 | + ), | |
| 25 | + ), | |
| 26 | + migrations.AddField( | |
| 27 | + model_name="corpus", | |
| 28 | + name="last_updated", | |
| 29 | + field=models.DateTimeField(auto_now=True), | |
| 30 | + ), | |
| 31 | + migrations.AlterField( | |
| 32 | + model_name="corpus", | |
| 33 | + name="word_count", | |
| 34 | + field=models.IntegerField(default=0), | |
| 35 | + ), | |
| 36 | + ] | |