Set up command to import data from Scryfall

This commit is contained in:
The Magician 2024-04-19 09:07:19 +01:00
parent 896a6666a9
commit 256b6e96f2
3 changed files with 16 additions and 5 deletions

View File

@ -1,2 +1,4 @@
dbup:
go run cmd/database/main.go
importdata: dbup
go run cmd/importdata/main.go

View File

@ -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")
}

View File

@ -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 (