From 9671c357f40132215f374ab348f5a1d494f65a30 Mon Sep 17 00:00:00 2001
From: Quaternions <krakow20@gmail.com>
Date: Mon, 31 Mar 2025 18:06:39 -0700
Subject: [PATCH] submissions: ruin script data model

---
 pkg/model/script.go | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/pkg/model/script.go b/pkg/model/script.go
index e736c98..61b011e 100644
--- a/pkg/model/script.go
+++ b/pkg/model/script.go
@@ -23,12 +23,20 @@ func HashParse(hash string) (uint64, error){
 	return strconv.ParseUint(hash, 16, 64)
 }
 
+type ResourceType int32
+const (
+	ResourceUnknown    ResourceType = 0
+	ResourceMapfix     ResourceType = 1
+	ResourceSubmission ResourceType = 2
+)
+
 type Script struct {
 	ID           int64 `gorm:"primaryKey"`
 	Name         string
 	Hash         int64 // postgres does not support unsigned integers, so we have to pretend
 	Source       string
-	SubmissionID int64 // which submission did this script first appear in
+	ResourceType ResourceType // is this a submission or is it a mapfix
+	ResourceID   int64 // which submission / mapfix did this script first appear in
 	CreatedAt    time.Time
 	UpdatedAt    time.Time
 }