From 7b75a7eea9ac8f992369334b39a5cf0a917c0059 Mon Sep 17 00:00:00 2001 From: w Date: Sun, 22 Jun 2025 01:14:32 -0300 Subject: [PATCH] Refactor card_stats migration to add power, charm, and wit columns to the card table --- migrations/0006_card_stats.sql | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/migrations/0006_card_stats.sql b/migrations/0006_card_stats.sql index 5a67de8..7d6b4bd 100644 --- a/migrations/0006_card_stats.sql +++ b/migrations/0006_card_stats.sql @@ -16,9 +16,11 @@ You should have received a copy of the GNU Affero General Public License along with this program. If not, see https://www.gnu.org/licenses/. */ -CREATE TABLE IF NOT EXISTS card_stats ( - card_id INTEGER PRIMARY KEY, - power INTEGER NOT NULL DEFAULT abs(random() % 9999), - charm INTEGER NOT NULL DEFAULT abs(random() % 9999),, - FOREIGN KEY(card_id) REFERENCES card(id) -) \ No newline at end of file +ALTER TABLE card + ADD COLUMN power INTEGER NOT NULL DEFAULT (abs(random() % 9999)); + +ALTER TABLE card + ADD COLUMN charm INTEGER NOT NULL DEFAULT (abs(random() % 9999)); + +ALTER TABLE card + ADD COLUMN wit INTEGER NOT NULL DEFAULT (abs(random() % 9999)); \ No newline at end of file