From 256b6e96f292b5652a4b88cd87a13772720a73cf Mon Sep 17 00:00:00 2001 From: The Magician Date: Fri, 19 Apr 2024 09:07:19 +0100 Subject: [PATCH] Set up command to import data from Scryfall --- sevenkeys/Makefile | 2 ++ sevenkeys/cmd/importdata/main.go | 13 +++++++++++++ sevenkeys/setup.sql | 6 +----- 3 files changed, 16 insertions(+), 5 deletions(-) create mode 100644 sevenkeys/cmd/importdata/main.go diff --git a/sevenkeys/Makefile b/sevenkeys/Makefile index 4b09c92..247243f 100644 --- a/sevenkeys/Makefile +++ b/sevenkeys/Makefile @@ -1,2 +1,4 @@ dbup: go run cmd/database/main.go +importdata: dbup + go run cmd/importdata/main.go diff --git a/sevenkeys/cmd/importdata/main.go b/sevenkeys/cmd/importdata/main.go new file mode 100644 index 0000000..875252a --- /dev/null +++ b/sevenkeys/cmd/importdata/main.go @@ -0,0 +1,13 @@ +package main + +import "fmt" + +func main() { + // Import colors + // Import sets + // Import keywords + // Import formats + // Import artists + // Import gamepieces and printings + fmt.Println("Hello, world from importdata") +} diff --git a/sevenkeys/setup.sql b/sevenkeys/setup.sql index 3785b84..30feab8 100644 --- a/sevenkeys/setup.sql +++ b/sevenkeys/setup.sql @@ -44,11 +44,6 @@ CREATE TABLE IF NOT EXISTS Color ( Name VARCHAR(5) NOT NULL, Abbreviation VARCHAR(1) NOT NULL ); -INSERT INTO Color (Name, Abbreviation) VALUES ("White", "W"); -INSERT INTO Color (Name, Abbreviation) VALUES ("Blue", "U"); -INSERT INTO Color (Name, Abbreviation) VALUES ("Black", "B"); -INSERT INTO Color (Name, Abbreviation) VALUES ("Red", "R"); -INSERT INTO Color (Name, Abbreviation) VALUES ("Green", "G"); CREATE TABLE IF NOT EXISTS GamepieceColor ( ColorId INT, @@ -106,6 +101,7 @@ CREATE TABLE IF NOT EXISTS ExpansionSet ( SetCode VARCHAR(4) NOT NULL, Name VARCHAR(40) NOT NULL, Digital BOOLEAN NOT NULL, + SetType VARCHAR(20) NOT NULL ); CREATE TABLE IF NOT EXISTS Artist (