Coverage for app/venv/lib/python3.14/site-packages/weblate/wladmin/migrations/0001_squashed_weblate_5.py: 100%
10 statements
« prev ^ index » next coverage.py v7.15.2, created at 2026-10-07 07:15 +0000
« prev ^ index » next coverage.py v7.15.2, created at 2026-10-07 07:15 +0000
1# Copyright © Michal Čihař <michal@weblate.org>
2#
3# SPDX-License-Identifier: GPL-3.0-or-later
5# Generated by Django 4.2.5 on 2023-09-18 08:35
7import django.db.models.deletion
8import django.utils.timezone
9from django.db import migrations, models
11import weblate.utils.backup
12import weblate.utils.validators
15class Migration(migrations.Migration):
16 replaces = [
17 ("wladmin", "0001_squashed_0008_auto_20191011_0816"),
18 ("wladmin", "0002_supportstatus_discoverable"),
19 ("wladmin", "0003_auto_20210512_1955"),
20 ("wladmin", "0004_alter_backupservice_repository"),
21 ("wladmin", "0005_alter_backuplog_event"),
22 (
23 "wladmin",
24 "0006_rename_configurationerror_ignored_timestamp_wladmin_con_ignored_fb498d_idx",
25 ),
26 ("wladmin", "0007_supportstatus_limits"),
27 ("wladmin", "0008_alter_backupservice_repository"),
28 ]
30 initial = True
32 dependencies = []
34 operations = [
35 migrations.CreateModel(
36 name="BackupService",
37 fields=[
38 (
39 "id",
40 models.AutoField(
41 auto_created=True,
42 primary_key=True,
43 serialize=False,
44 verbose_name="ID",
45 ),
46 ),
47 (
48 "repository",
49 models.CharField(
50 default="",
51 help_text="Use /path/to/repo for local backups or user@host:/path/to/repo or ssh://user@host:port/path/to/backups for remote SSH backups.",
52 max_length=500,
53 validators=[weblate.utils.validators.validate_backup_path],
54 verbose_name="Backup repository URL",
55 ),
56 ),
57 ("enabled", models.BooleanField(default=True)),
58 ("timestamp", models.DateTimeField(default=django.utils.timezone.now)),
59 ("paperkey", models.TextField()),
60 (
61 "passphrase",
62 models.CharField(
63 default=weblate.utils.backup.make_password, max_length=100
64 ),
65 ),
66 ],
67 options={
68 "verbose_name": "Support service",
69 "verbose_name_plural": "Support services",
70 },
71 ),
72 migrations.CreateModel(
73 name="BackupLog",
74 fields=[
75 (
76 "id",
77 models.AutoField(
78 auto_created=True,
79 primary_key=True,
80 serialize=False,
81 verbose_name="ID",
82 ),
83 ),
84 ("timestamp", models.DateTimeField(default=django.utils.timezone.now)),
85 (
86 "event",
87 models.CharField(
88 choices=[
89 ("backup", "Backup performed"),
90 ("error", "Backup failed"),
91 ("prune", "Deleted the oldest backups"),
92 ("cleanup", "Cleaned up backup storage"),
93 ("init", "Repository initialization"),
94 ],
95 db_index=True,
96 max_length=100,
97 ),
98 ),
99 ("log", models.TextField()),
100 (
101 "service",
102 models.ForeignKey(
103 on_delete=django.db.models.deletion.CASCADE,
104 to="wladmin.backupservice",
105 ),
106 ),
107 ],
108 options={
109 "verbose_name": "Backup log",
110 "verbose_name_plural": "Backup logs",
111 },
112 ),
113 migrations.CreateModel(
114 name="ConfigurationError",
115 fields=[
116 (
117 "id",
118 models.AutoField(
119 auto_created=True,
120 primary_key=True,
121 serialize=False,
122 verbose_name="ID",
123 ),
124 ),
125 ("name", models.CharField(max_length=150, unique=True)),
126 ("message", models.TextField()),
127 ("timestamp", models.DateTimeField(default=django.utils.timezone.now)),
128 ("ignored", models.BooleanField(db_index=True, default=False)),
129 ],
130 options={
131 "verbose_name": "Configuration error",
132 "verbose_name_plural": "Configuration errors",
133 "indexes": [
134 models.Index(
135 fields=["ignored", "timestamp"],
136 name="wladmin_con_ignored_fb498d_idx",
137 )
138 ],
139 },
140 ),
141 migrations.CreateModel(
142 name="SupportStatus",
143 fields=[
144 (
145 "id",
146 models.AutoField(
147 auto_created=True,
148 primary_key=True,
149 serialize=False,
150 verbose_name="ID",
151 ),
152 ),
153 ("name", models.CharField(max_length=150)),
154 ("secret", models.CharField(max_length=400)),
155 ("expiry", models.DateTimeField(db_index=True, null=True)),
156 ("in_limits", models.BooleanField(default=True)),
157 ("discoverable", models.BooleanField(default=False)),
158 ("limits", models.JSONField(default=dict)),
159 ],
160 options={
161 "verbose_name": "Support status",
162 "verbose_name_plural": "Support statuses",
163 },
164 ),
165 ]