Skip to content

Commit 1cb362e

Browse files
committed
chore: state fix
1 parent fe5f5c0 commit 1cb362e

File tree

5 files changed

+25
-3
lines changed

5 files changed

+25
-3
lines changed

db/schema/version.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ func (Version) Fields() []ent.Field {
2626
field.String("mod_id"),
2727
field.String("version").MaxLen(16),
2828
field.String("game_version"),
29-
field.Bool("required_on_remote"),
29+
field.Bool("required_on_remote").Default(true),
3030
field.String("changelog").Optional(),
3131
field.Uint("downloads").Default(0),
3232
field.String("key").Optional(),

go.mod

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
module github.com/satisfactorymodding/smr-api
22

3-
go 1.22.3
3+
go 1.22.5
4+
5+
toolchain go1.23.0
46

57
require (
68
ariga.io/entcache v0.1.0
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
-- reverse: drop "generate_random_id" function
2+
CREATE FUNCTION "generate_random_id" ("length" integer) RETURNS text LANGUAGE plpgsql AS $$
3+
declare
4+
chars text[] := '{0,1,2,3,4,5,6,7,8,9,A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z}';
5+
result text := '';
6+
i integer := 0;
7+
begin
8+
if length < 0 then
9+
raise exception 'Given length cannot be less than 0';
10+
end if;
11+
for i in 1..length loop
12+
result := result || chars[1+random()*(array_length(chars, 1)-1)];
13+
end loop;
14+
return result;
15+
end;
16+
$$;
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
-- drop "generate_random_id" function
2+
DROP FUNCTION "generate_random_id";

migrations/sql/atlas.sum

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
h1:y/Q8pNjcrL7pi8F3JUxIBsFUtvbWFdFKmH3sqWVr3zs=
1+
h1:67tUWb0QFZPzh+o8osVd09uCPAo5q/JBGeWwsNVV+PQ=
22
000001_create_initial_tables.down.sql h1:QcXXwE8ir3PM3vZjQfBihY55WiuLYjN8pbbk/L6U+bs=
33
000001_create_initial_tables.up.sql h1:EfAqETefs7TW9BDVS4ukiB7wUFs+HQzVdc3qHhdAFd4=
44
000002_create_user_group_table.down.sql h1:uJjRbQ3H7yvPGNXLD5iSPmderEoWhCNGdsqN8yqBIRY=
@@ -73,3 +73,5 @@ h1:y/Q8pNjcrL7pi8F3JUxIBsFUtvbWFdFKmH3sqWVr3zs=
7373
20240826153722_add_thumbhash.up.sql h1:7a9d40zpOnKMamxW14ql3WFXiwXD4O6AjwMlAOVE7ik=
7474
20240930114249_add_required_on_remote.down.sql h1:cbW5+35gg4R78zsjcqPO94e8X1QcYB9nPllGgtKGOr8=
7575
20240930114249_add_required_on_remote.up.sql h1:NZJmXjtKEIHRhVlSSu9nKADo/8xhZAeckrf6NoZMmjk=
76+
20241002191358_state_fix.down.sql h1:EnNOr58ajtIPS7BIgA6l60Jr8hE0ufCE6t0zFdvfnaw=
77+
20241002191358_state_fix.up.sql h1:4bVw9fxEP9MrHBSYuRF3vFCgaWF79EUeacD3e+vSQR4=

0 commit comments

Comments
 (0)