Go back to sqlite

This commit is contained in:
Joakim Hellsén 2025-08-07 01:01:46 +02:00
commit f84b59cb4f
10 changed files with 27 additions and 173 deletions

View file

@ -1,4 +1,4 @@
# Generated by Django 5.2.4 on 2025-07-23 23:51 # Generated by Django 5.2.5 on 2025-08-06 23:01
import django.contrib.auth.models import django.contrib.auth.models
import django.contrib.auth.validators import django.contrib.auth.validators

View file

@ -1,45 +0,0 @@
services:
ttvdrops_postgres:
image: postgres:17-bookworm
environment:
POSTGRES_USER: ttvdrops
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD?You must set POSTGRES_PASSWORD}
POSTGRES_DB: ttvdrops
PGDATA: /data
command: postgres -c config_file=/config/postgresql.conf
shm_size: 5g
ports:
- "5432:5432"
healthcheck:
test: ["CMD-SHELL", "pg_isready", "-d", "ttvdrops", "-U", "ttvdrops"]
interval: 30s
timeout: 60s
retries: 5
start_period: 30s
restart: always
networks:
- ttvdrops
volumes:
- /mnt/Docker/Data/ttvdrops/postgresql/data:/data
- /mnt/Docker/Data/ttvdrops/postgresql/config:/config
ttvdrops_pgbouncer:
image: edoburu/pgbouncer
restart: always
depends_on:
- ttvdrops_postgres
ports:
- "6432:6432"
environment:
DB_USER: ttvdrops
DB_PASSWORD: ${POSTGRES_PASSWORD}
DB_HOST: ttvdrops_postgres
DB_NAME: ttvdrops
POOL_MODE: transaction
MAX_CLIENT_CONN: 200
DEFAULT_POOL_SIZE: 20
networks:
- ttvdrops
networks:
ttvdrops:

View file

@ -1,19 +0,0 @@
checkpoint_completion_target = 0.9
default_statistics_target = 100
effective_cache_size = 12GB
effective_io_concurrency = 200
huge_pages = off
listen_addresses = '*'
maintenance_work_mem = 1GB
max_connections = 50
max_parallel_maintenance_workers = 4
max_parallel_workers = 12
max_parallel_workers_per_gather = 4
max_wal_size = 4GB
max_worker_processes = 12
min_wal_size = 1GB
random_page_cost = 1.1
shared_buffers = 4GB
superuser_reserved_connections = 3
wal_buffers = 16MB
work_mem = 19784kB

View file

@ -5,11 +5,11 @@ description = "Get notified when a new drop is available on Twitch."
readme = "README.md" readme = "README.md"
requires-python = ">=3.13" requires-python = ">=3.13"
dependencies = [ dependencies = [
"django>=5.2.4",
"django-browser-reload>=1.18.0", "django-browser-reload>=1.18.0",
"django-debug-toolbar>=5.2.0", "django-debug-toolbar>=5.2.0",
"django-stubs[compatible-mypy]>=5.2.2", "django-stubs[compatible-mypy]>=5.2.2",
"django-watchfiles>=1.1.0", "django-watchfiles>=1.1.0",
"django>=5.2.4",
"djlint>=1.36.4", "djlint>=1.36.4",
"orjson>=3.11.1", "orjson>=3.11.1",
"platformdirs>=4.3.8", "platformdirs>=4.3.8",

View file

@ -1,6 +1,7 @@
# Generated by Django 5.2.4 on 2025-07-23 23:51 # Generated by Django 5.2.4 on 2025-08-06 04:12
import django.db.models.deletion import django.db.models.deletion
from django.conf import settings
from django.db import migrations, models from django.db import migrations, models
@ -9,6 +10,7 @@ class Migration(migrations.Migration):
initial = True initial = True
dependencies = [ dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
] ]
operations = [ operations = [
@ -21,7 +23,7 @@ class Migration(migrations.Migration):
('created_at', models.DateTimeField(db_index=True)), ('created_at', models.DateTimeField(db_index=True)),
('entitlement_limit', models.PositiveIntegerField(default=1)), ('entitlement_limit', models.PositiveIntegerField(default=1)),
('is_ios_available', models.BooleanField(default=False)), ('is_ios_available', models.BooleanField(default=False)),
('distribution_type', models.TextField(choices=[('DIRECT_ENTITLEMENT', 'Direct Entitlement'), ('CODE', 'Code')], db_index=True)), ('distribution_type', models.TextField(db_index=True)),
], ],
), ),
migrations.CreateModel( migrations.CreateModel(
@ -38,6 +40,7 @@ class Migration(migrations.Migration):
('id', models.TextField(primary_key=True, serialize=False)), ('id', models.TextField(primary_key=True, serialize=False)),
('slug', models.TextField(blank=True, db_index=True, default='')), ('slug', models.TextField(blank=True, db_index=True, default='')),
('display_name', models.TextField(db_index=True)), ('display_name', models.TextField(db_index=True)),
('box_art', models.URLField(blank=True, default='', max_length=500)),
], ],
options={ options={
'indexes': [models.Index(fields=['slug'], name='twitch_game_slug_a02d3c_idx'), models.Index(fields=['display_name'], name='twitch_game_display_a35ba3_idx')], 'indexes': [models.Index(fields=['slug'], name='twitch_game_slug_a02d3c_idx'), models.Index(fields=['display_name'], name='twitch_game_display_a35ba3_idx')],
@ -99,6 +102,20 @@ class Migration(migrations.Migration):
name='drop', name='drop',
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='twitch.timebaseddrop'), field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='twitch.timebaseddrop'),
), ),
migrations.CreateModel(
name='NotificationSubscription',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('notify_found', models.BooleanField(default=False)),
('notify_live', models.BooleanField(default=False)),
('game', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='twitch.game')),
('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
('organization', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='twitch.organization')),
],
options={
'unique_together': {('user', 'game'), ('user', 'organization')},
},
),
migrations.AddIndex( migrations.AddIndex(
model_name='dropcampaign', model_name='dropcampaign',
index=models.Index(fields=['name'], name='twitch_drop_name_3b70b3_idx'), index=models.Index(fields=['name'], name='twitch_drop_name_3b70b3_idx'),

View file

@ -1,29 +0,0 @@
# Generated by Django 5.2.4 on 2025-08-02 02:08
import django.db.models.deletion
from django.conf import settings
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('twitch', '0001_initial'),
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
operations = [
migrations.CreateModel(
name='NotificationSubscription',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('notify_found', models.BooleanField(default=False)),
('notify_live', models.BooleanField(default=False)),
('game', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='twitch.game')),
('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
],
options={
'unique_together': {('user', 'game')},
},
),
]

View file

@ -1,34 +0,0 @@
# Generated by Django 5.2.4 on 2025-08-02 03:39
import django.db.models.deletion
from django.conf import settings
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('twitch', '0002_notificationsubscription'),
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
operations = [
migrations.AlterUniqueTogether(
name='notificationsubscription',
unique_together={('user', 'game')},
),
migrations.AddField(
model_name='notificationsubscription',
name='organization',
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='twitch.organization'),
),
migrations.AlterField(
model_name='notificationsubscription',
name='game',
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='twitch.game'),
),
migrations.AlterUniqueTogether(
name='notificationsubscription',
unique_together={('user', 'game'), ('user', 'organization')},
),
]

View file

@ -1,18 +0,0 @@
# Generated by Django 5.2.4 on 2025-08-03 22:14
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('twitch', '0003_alter_notificationsubscription_unique_together_and_more'),
]
operations = [
migrations.AlterField(
model_name='dropbenefit',
name='distribution_type',
field=models.TextField(db_index=True),
),
]

View file

@ -1,18 +0,0 @@
# Generated by Django 5.2.4 on 2025-08-04 03:19
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('twitch', '0004_alter_dropbenefit_distribution_type'),
]
operations = [
migrations.AddField(
model_name='game',
name='box_art',
field=models.URLField(blank=True, default='', max_length=500),
),
]

12
uv.lock generated
View file

@ -4,15 +4,15 @@ requires-python = ">=3.13"
[[package]] [[package]]
name = "anyio" name = "anyio"
version = "4.9.0" version = "4.10.0"
source = { registry = "https://pypi.org/simple" } source = { registry = "https://pypi.org/simple" }
dependencies = [ dependencies = [
{ name = "idna" }, { name = "idna" },
{ name = "sniffio" }, { name = "sniffio" },
] ]
sdist = { url = "https://files.pythonhosted.org/packages/95/7d/4c1bd541d4dffa1b52bd83fb8527089e097a106fc90b467a7313b105f840/anyio-4.9.0.tar.gz", hash = "sha256:673c0c244e15788651a4ff38710fea9675823028a6f08a5eda409e0c9840a028", size = 190949, upload-time = "2025-03-17T00:02:54.77Z" } sdist = { url = "https://files.pythonhosted.org/packages/f1/b4/636b3b65173d3ce9a38ef5f0522789614e590dab6a8d505340a4efe4c567/anyio-4.10.0.tar.gz", hash = "sha256:3f3fae35c96039744587aa5b8371e7e8e603c0702999535961dd336026973ba6", size = 213252, upload-time = "2025-08-04T08:54:26.451Z" }
wheels = [ wheels = [
{ url = "https://files.pythonhosted.org/packages/a1/ee/48ca1a7c89ffec8b6a0c5d02b89c305671d5ffd8d3c94acf8b8c408575bb/anyio-4.9.0-py3-none-any.whl", hash = "sha256:9f76d541cad6e36af7beb62e978876f3b41e3e04f2c1fbf0884604c0a9c4d93c", size = 100916, upload-time = "2025-03-17T00:02:52.713Z" }, { url = "https://files.pythonhosted.org/packages/6f/12/e5e0282d673bb9746bacfb6e2dba8719989d3660cdb2ea79aee9a9651afb/anyio-4.10.0-py3-none-any.whl", hash = "sha256:60e474ac86736bbfd6f210f7a61218939c318f43f9972497381f1c5e930ed3d1", size = 107213, upload-time = "2025-08-04T08:54:24.882Z" },
] ]
[[package]] [[package]]
@ -61,16 +61,16 @@ wheels = [
[[package]] [[package]]
name = "django" name = "django"
version = "5.2.4" version = "5.2.5"
source = { registry = "https://pypi.org/simple" } source = { registry = "https://pypi.org/simple" }
dependencies = [ dependencies = [
{ name = "asgiref" }, { name = "asgiref" },
{ name = "sqlparse" }, { name = "sqlparse" },
{ name = "tzdata", marker = "sys_platform == 'win32'" }, { name = "tzdata", marker = "sys_platform == 'win32'" },
] ]
sdist = { url = "https://files.pythonhosted.org/packages/9c/7e/034f0f9fb10c029a02daaf44d364d6bf2eced8c73f0d38c69da359d26b01/django-5.2.4.tar.gz", hash = "sha256:a1228c384f8fa13eebc015196db7b3e08722c5058d4758d20cb287503a540d8f", size = 10831909, upload-time = "2025-07-02T18:47:39.19Z" } sdist = { url = "https://files.pythonhosted.org/packages/62/9b/779f853c3d2d58b9e08346061ff3e331cdec3fe3f53aae509e256412a593/django-5.2.5.tar.gz", hash = "sha256:0745b25681b129a77aae3d4f6549b62d3913d74407831abaa0d9021a03954bae", size = 10859748, upload-time = "2025-08-06T08:26:29.978Z" }
wheels = [ wheels = [
{ url = "https://files.pythonhosted.org/packages/14/ae/706965237a672434c8b520e89a818e8b047af94e9beb342d0bee405c26c7/django-5.2.4-py3-none-any.whl", hash = "sha256:60c35bd96201b10c6e7a78121bd0da51084733efa303cc19ead021ab179cef5e", size = 8302187, upload-time = "2025-07-02T18:47:35.373Z" }, { url = "https://files.pythonhosted.org/packages/9d/6e/98a1d23648e0085bb5825326af17612ecd8fc76be0ce96ea4dc35e17b926/django-5.2.5-py3-none-any.whl", hash = "sha256:2b2ada0ee8a5ff743a40e2b9820d1f8e24c11bac9ae6469cd548f0057ea6ddcd", size = 8302999, upload-time = "2025-08-06T08:26:23.562Z" },
] ]
[[package]] [[package]]