Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
陈曦
sub2api
Commits
9c514c98
Commit
9c514c98
authored
Apr 05, 2026
by
erio
Browse files
chore: drop Sora database schema and regenerate ent code
parent
62e80c60
Changes
22
Hide whitespace changes
Inline
Side-by-side
backend/ent/user_update.go
View file @
9c514c98
...
@@ -242,48 +242,6 @@ func (_u *UserUpdate) ClearTotpEnabledAt() *UserUpdate {
...
@@ -242,48 +242,6 @@ func (_u *UserUpdate) ClearTotpEnabledAt() *UserUpdate {
return
_u
return
_u
}
}
// SetSoraStorageQuotaBytes sets the "sora_storage_quota_bytes" field.
func
(
_u
*
UserUpdate
)
SetSoraStorageQuotaBytes
(
v
int64
)
*
UserUpdate
{
_u
.
mutation
.
ResetSoraStorageQuotaBytes
()
_u
.
mutation
.
SetSoraStorageQuotaBytes
(
v
)
return
_u
}
// SetNillableSoraStorageQuotaBytes sets the "sora_storage_quota_bytes" field if the given value is not nil.
func
(
_u
*
UserUpdate
)
SetNillableSoraStorageQuotaBytes
(
v
*
int64
)
*
UserUpdate
{
if
v
!=
nil
{
_u
.
SetSoraStorageQuotaBytes
(
*
v
)
}
return
_u
}
// AddSoraStorageQuotaBytes adds value to the "sora_storage_quota_bytes" field.
func
(
_u
*
UserUpdate
)
AddSoraStorageQuotaBytes
(
v
int64
)
*
UserUpdate
{
_u
.
mutation
.
AddSoraStorageQuotaBytes
(
v
)
return
_u
}
// SetSoraStorageUsedBytes sets the "sora_storage_used_bytes" field.
func
(
_u
*
UserUpdate
)
SetSoraStorageUsedBytes
(
v
int64
)
*
UserUpdate
{
_u
.
mutation
.
ResetSoraStorageUsedBytes
()
_u
.
mutation
.
SetSoraStorageUsedBytes
(
v
)
return
_u
}
// SetNillableSoraStorageUsedBytes sets the "sora_storage_used_bytes" field if the given value is not nil.
func
(
_u
*
UserUpdate
)
SetNillableSoraStorageUsedBytes
(
v
*
int64
)
*
UserUpdate
{
if
v
!=
nil
{
_u
.
SetSoraStorageUsedBytes
(
*
v
)
}
return
_u
}
// AddSoraStorageUsedBytes adds value to the "sora_storage_used_bytes" field.
func
(
_u
*
UserUpdate
)
AddSoraStorageUsedBytes
(
v
int64
)
*
UserUpdate
{
_u
.
mutation
.
AddSoraStorageUsedBytes
(
v
)
return
_u
}
// AddAPIKeyIDs adds the "api_keys" edge to the APIKey entity by IDs.
// AddAPIKeyIDs adds the "api_keys" edge to the APIKey entity by IDs.
func
(
_u
*
UserUpdate
)
AddAPIKeyIDs
(
ids
...
int64
)
*
UserUpdate
{
func
(
_u
*
UserUpdate
)
AddAPIKeyIDs
(
ids
...
int64
)
*
UserUpdate
{
_u
.
mutation
.
AddAPIKeyIDs
(
ids
...
)
_u
.
mutation
.
AddAPIKeyIDs
(
ids
...
)
...
@@ -751,18 +709,6 @@ func (_u *UserUpdate) sqlSave(ctx context.Context) (_node int, err error) {
...
@@ -751,18 +709,6 @@ func (_u *UserUpdate) sqlSave(ctx context.Context) (_node int, err error) {
if
_u
.
mutation
.
TotpEnabledAtCleared
()
{
if
_u
.
mutation
.
TotpEnabledAtCleared
()
{
_spec
.
ClearField
(
user
.
FieldTotpEnabledAt
,
field
.
TypeTime
)
_spec
.
ClearField
(
user
.
FieldTotpEnabledAt
,
field
.
TypeTime
)
}
}
if
value
,
ok
:=
_u
.
mutation
.
SoraStorageQuotaBytes
();
ok
{
_spec
.
SetField
(
user
.
FieldSoraStorageQuotaBytes
,
field
.
TypeInt64
,
value
)
}
if
value
,
ok
:=
_u
.
mutation
.
AddedSoraStorageQuotaBytes
();
ok
{
_spec
.
AddField
(
user
.
FieldSoraStorageQuotaBytes
,
field
.
TypeInt64
,
value
)
}
if
value
,
ok
:=
_u
.
mutation
.
SoraStorageUsedBytes
();
ok
{
_spec
.
SetField
(
user
.
FieldSoraStorageUsedBytes
,
field
.
TypeInt64
,
value
)
}
if
value
,
ok
:=
_u
.
mutation
.
AddedSoraStorageUsedBytes
();
ok
{
_spec
.
AddField
(
user
.
FieldSoraStorageUsedBytes
,
field
.
TypeInt64
,
value
)
}
if
_u
.
mutation
.
APIKeysCleared
()
{
if
_u
.
mutation
.
APIKeysCleared
()
{
edge
:=
&
sqlgraph
.
EdgeSpec
{
edge
:=
&
sqlgraph
.
EdgeSpec
{
Rel
:
sqlgraph
.
O2M
,
Rel
:
sqlgraph
.
O2M
,
...
@@ -1406,48 +1352,6 @@ func (_u *UserUpdateOne) ClearTotpEnabledAt() *UserUpdateOne {
...
@@ -1406,48 +1352,6 @@ func (_u *UserUpdateOne) ClearTotpEnabledAt() *UserUpdateOne {
return
_u
return
_u
}
}
// SetSoraStorageQuotaBytes sets the "sora_storage_quota_bytes" field.
func
(
_u
*
UserUpdateOne
)
SetSoraStorageQuotaBytes
(
v
int64
)
*
UserUpdateOne
{
_u
.
mutation
.
ResetSoraStorageQuotaBytes
()
_u
.
mutation
.
SetSoraStorageQuotaBytes
(
v
)
return
_u
}
// SetNillableSoraStorageQuotaBytes sets the "sora_storage_quota_bytes" field if the given value is not nil.
func
(
_u
*
UserUpdateOne
)
SetNillableSoraStorageQuotaBytes
(
v
*
int64
)
*
UserUpdateOne
{
if
v
!=
nil
{
_u
.
SetSoraStorageQuotaBytes
(
*
v
)
}
return
_u
}
// AddSoraStorageQuotaBytes adds value to the "sora_storage_quota_bytes" field.
func
(
_u
*
UserUpdateOne
)
AddSoraStorageQuotaBytes
(
v
int64
)
*
UserUpdateOne
{
_u
.
mutation
.
AddSoraStorageQuotaBytes
(
v
)
return
_u
}
// SetSoraStorageUsedBytes sets the "sora_storage_used_bytes" field.
func
(
_u
*
UserUpdateOne
)
SetSoraStorageUsedBytes
(
v
int64
)
*
UserUpdateOne
{
_u
.
mutation
.
ResetSoraStorageUsedBytes
()
_u
.
mutation
.
SetSoraStorageUsedBytes
(
v
)
return
_u
}
// SetNillableSoraStorageUsedBytes sets the "sora_storage_used_bytes" field if the given value is not nil.
func
(
_u
*
UserUpdateOne
)
SetNillableSoraStorageUsedBytes
(
v
*
int64
)
*
UserUpdateOne
{
if
v
!=
nil
{
_u
.
SetSoraStorageUsedBytes
(
*
v
)
}
return
_u
}
// AddSoraStorageUsedBytes adds value to the "sora_storage_used_bytes" field.
func
(
_u
*
UserUpdateOne
)
AddSoraStorageUsedBytes
(
v
int64
)
*
UserUpdateOne
{
_u
.
mutation
.
AddSoraStorageUsedBytes
(
v
)
return
_u
}
// AddAPIKeyIDs adds the "api_keys" edge to the APIKey entity by IDs.
// AddAPIKeyIDs adds the "api_keys" edge to the APIKey entity by IDs.
func
(
_u
*
UserUpdateOne
)
AddAPIKeyIDs
(
ids
...
int64
)
*
UserUpdateOne
{
func
(
_u
*
UserUpdateOne
)
AddAPIKeyIDs
(
ids
...
int64
)
*
UserUpdateOne
{
_u
.
mutation
.
AddAPIKeyIDs
(
ids
...
)
_u
.
mutation
.
AddAPIKeyIDs
(
ids
...
)
...
@@ -1945,18 +1849,6 @@ func (_u *UserUpdateOne) sqlSave(ctx context.Context) (_node *User, err error) {
...
@@ -1945,18 +1849,6 @@ func (_u *UserUpdateOne) sqlSave(ctx context.Context) (_node *User, err error) {
if
_u
.
mutation
.
TotpEnabledAtCleared
()
{
if
_u
.
mutation
.
TotpEnabledAtCleared
()
{
_spec
.
ClearField
(
user
.
FieldTotpEnabledAt
,
field
.
TypeTime
)
_spec
.
ClearField
(
user
.
FieldTotpEnabledAt
,
field
.
TypeTime
)
}
}
if
value
,
ok
:=
_u
.
mutation
.
SoraStorageQuotaBytes
();
ok
{
_spec
.
SetField
(
user
.
FieldSoraStorageQuotaBytes
,
field
.
TypeInt64
,
value
)
}
if
value
,
ok
:=
_u
.
mutation
.
AddedSoraStorageQuotaBytes
();
ok
{
_spec
.
AddField
(
user
.
FieldSoraStorageQuotaBytes
,
field
.
TypeInt64
,
value
)
}
if
value
,
ok
:=
_u
.
mutation
.
SoraStorageUsedBytes
();
ok
{
_spec
.
SetField
(
user
.
FieldSoraStorageUsedBytes
,
field
.
TypeInt64
,
value
)
}
if
value
,
ok
:=
_u
.
mutation
.
AddedSoraStorageUsedBytes
();
ok
{
_spec
.
AddField
(
user
.
FieldSoraStorageUsedBytes
,
field
.
TypeInt64
,
value
)
}
if
_u
.
mutation
.
APIKeysCleared
()
{
if
_u
.
mutation
.
APIKeysCleared
()
{
edge
:=
&
sqlgraph
.
EdgeSpec
{
edge
:=
&
sqlgraph
.
EdgeSpec
{
Rel
:
sqlgraph
.
O2M
,
Rel
:
sqlgraph
.
O2M
,
...
...
backend/migrations/090_drop_sora.sql
0 → 100644
View file @
9c514c98
-- Migration: 090_drop_sora
-- Remove all Sora-related database objects.
-- Drops tables: sora_tasks, sora_generations, sora_accounts
-- Drops columns from: groups, users, usage_logs
-- ============================================================
-- 1. Drop Sora tables
-- ============================================================
DROP
TABLE
IF
EXISTS
sora_tasks
;
DROP
TABLE
IF
EXISTS
sora_generations
;
DROP
TABLE
IF
EXISTS
sora_accounts
;
-- ============================================================
-- 2. Drop Sora columns from groups table
-- ============================================================
ALTER
TABLE
groups
DROP
COLUMN
IF
EXISTS
sora_image_price_360
,
DROP
COLUMN
IF
EXISTS
sora_image_price_540
,
DROP
COLUMN
IF
EXISTS
sora_video_price_per_request
,
DROP
COLUMN
IF
EXISTS
sora_video_price_per_request_hd
,
DROP
COLUMN
IF
EXISTS
sora_storage_quota_bytes
;
-- ============================================================
-- 3. Drop Sora columns from users table
-- ============================================================
ALTER
TABLE
users
DROP
COLUMN
IF
EXISTS
sora_storage_quota_bytes
,
DROP
COLUMN
IF
EXISTS
sora_storage_used_bytes
;
-- ============================================================
-- 4. Drop Sora column from usage_logs table
-- ============================================================
ALTER
TABLE
usage_logs
DROP
COLUMN
IF
EXISTS
media_type
;
Prev
1
2
Next
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment