feat: add public homepage and downloads
This commit is contained in:
@@ -0,0 +1,37 @@
|
||||
# Generated by Django 5.2.15 on 2026-07-06 09:48
|
||||
|
||||
import django.core.validators
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
initial = True
|
||||
|
||||
dependencies = [
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.CreateModel(
|
||||
name='DownloadRelease',
|
||||
fields=[
|
||||
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||
('platform', models.CharField(choices=[('windows', 'Windows'), ('macos', 'macOS'), ('linux', 'Linux')], max_length=32, verbose_name='平台')),
|
||||
('version', models.CharField(max_length=64, verbose_name='版本')),
|
||||
('file', models.FileField(blank=True, upload_to='downloads/', verbose_name='安装包文件')),
|
||||
('external_url', models.URLField(blank=True, verbose_name='外部下载地址')),
|
||||
('sha256', models.CharField(blank=True, max_length=64, validators=[django.core.validators.RegexValidator(message='SHA256 必须是 64 位十六进制字符。', regex='^[A-Fa-f0-9]{64}$')], verbose_name='SHA256')),
|
||||
('is_current', models.BooleanField(default=False, verbose_name='当前版本')),
|
||||
('release_notes', models.TextField(blank=True, verbose_name='发布说明')),
|
||||
('created_at', models.DateTimeField(auto_now_add=True, verbose_name='创建时间')),
|
||||
('updated_at', models.DateTimeField(auto_now=True, verbose_name='更新时间')),
|
||||
],
|
||||
options={
|
||||
'db_table': 'download_release',
|
||||
'verbose_name': '客户端下载版本',
|
||||
'verbose_name_plural': '客户端下载版本',
|
||||
'ordering': ('platform', '-is_current', '-created_at', '-id'),
|
||||
'indexes': [models.Index(fields=['platform', 'is_current'], name='dl_platform_current_idx')],
|
||||
},
|
||||
),
|
||||
]
|
||||
Reference in New Issue
Block a user