func (db *DB) SetupAuctionTables(auctionSchema string, puzzleSchema string, puzzleTable string, auctionOrderSchema string, auctionOrderTable string) (err error) {

	// Initialize auction order schema, table
	// An auction order is identified by it's auction ID, pubkey, nonce, and other specific data.
	// You can have a price up to 30 digits total, and 10 decimal places.
	// Could be using blob instead of text but it really doesn't matter
	if err = db.InitializePairTables(auctionSchema, "pubkey VARBINARY(66), side TEXT, price DOUBLE(30,2) UNSIGNED, amountHave BIGINT(64), amountWant BIGINT(64), auctionID VARBINARY(64), nonce VARBINARY(4), hashedOrder VARBINARY(64), PRIMARY KEY (hashedOrder)"); err != nil {
		err = fmt.Errorf("Could not initialize auction order tables: \n%s", err)
		return
	}

	// This creates the single table where we'll keep all the puzzles
	if err = db.InitializeSingleTable(puzzleSchema, puzzleTable, "encodedOrder TEXT, auctionID VARBINARY(64), selected BOOLEAN"); err != nil {
		err = fmt.Errorf("Could not initialize puzzle table: \n%s", err)
		return
	}

	// This creates the single table where we'll keep the mapping of auction ID to auction number
	if err = db.InitializeSingleTable(auctionOrderSchema, auctionOrderTable, "auctionID VARBINARY(64), auctionNumber BIGINT(64), PRIMARY KEY (auctionNumber)"); err != nil {
		err = fmt.Errorf("Could not initialize auction order map table: %s", err)
		return
	}

	return
}
// SetupAuctionTables sets up the tables needed to store auction orders and puzzles for specific auctions
SetupAuctionTables sets up the tables needed to store auction orders and puzzles for specific auctions
// SetupAuctionTables sets up the tables needed to store auction orders and puzzles for specific auctions
func (db *DB) SetupAuctionTables(auctionSchema string, puzzleSchema string, puzzleTable string, auctionOrderSchema string, auctionOrderTable string) (err error) {
	if err = db.InitializePairTables(auctionSchema, "pubkey VARBINARY(66), side TEXT, price DOUBLE(30,2) UNSIGNED, amountHave BIGINT(64), amountWant BIGINT(64), auctionID VARBINARY(64), nonce VARBINARY(4), hashedOrder VARBINARY(64), PRIMARY KEY (hashedOrder)"); err != nil {
		err = fmt.Errorf("Could not initialize auction order tables: \n%s", err)
		return
	}
	if err = db.InitializeSingleTable(puzzleSchema, puzzleTable, "encodedOrder TEXT, auctionID VARBINARY(64), selected BOOLEAN"); err != nil {
		err = fmt.Errorf("Could not initialize puzzle table: \n%s", err)
		return
	}
	if err = db.InitializeSingleTable(auctionOrderSchema, auctionOrderTable, "auctionID VARBINARY(64), auctionNumber BIGINT(64), PRIMARY KEY (auctionNumber)"); err != nil {
		err = fmt.Errorf("Could not initialize auction order map table: %s", err)
		return
	}
	return
}
func ( db * DB ) SetupAuctionTables ( auctionSchema string , puzzleSchema string , puzzleTable string , auctionOrderSchema string , auctionOrderTable string ) ( err error ) { if err = db . InitializePairTables ( auctionSchema , " " ) ; err != nil { err = fmt . Errorf ( " \n " , err ) return } if err = db . InitializeSingleTable ( puzzleSchema , puzzleTable , " " ) ; err != nil { err = fmt . Errorf ( " \n " , err ) return } if err = db . InitializeSingleTable ( auctionOrderSchema , auctionOrderTable , " " ) ; err != nil { err = fmt . Errorf ( " " , err ) return } return }
SetupAuctionTables sets up the tables needed to store auction orders and puzzles for specific auctions
SetupAuctionTables sets up the tables needed to store auction orders and puzzles for specific auctions
// Initialize auction order schema, table // An auction order is identified by it's auction ID, pubkey, nonce, and other specific data. // You can have a price up to 30 digits total, and 10 decimal places. // Could be using blob instead of text but it really doesn't matter // This creates the single table where we'll keep all the puzzles // This creates the single table where we'll keep the mapping of auction ID to auction number