|
|
@@ -28,7 +28,7 @@ func postgresSetup(db *sql.DB) error {
|
|
|
}
|
|
|
|
|
|
row := db.QueryRow(`SELECT 'DevicesDeviceIDIndex'::regclass`)
|
|
|
- if err := row.Scan(nil); err != nil {
|
|
|
+ if err = row.Scan(nil); err != nil {
|
|
|
_, err = db.Exec(`CREATE INDEX DevicesDeviceIDIndex ON Devices (DeviceID)`)
|
|
|
}
|
|
|
if err != nil {
|
|
|
@@ -36,7 +36,7 @@ func postgresSetup(db *sql.DB) error {
|
|
|
}
|
|
|
|
|
|
row = db.QueryRow(`SELECT 'DevicesSeenIndex'::regclass`)
|
|
|
- if err := row.Scan(nil); err != nil {
|
|
|
+ if err = row.Scan(nil); err != nil {
|
|
|
_, err = db.Exec(`CREATE INDEX DevicesSeenIndex ON Devices (Seen)`)
|
|
|
}
|
|
|
if err != nil {
|
|
|
@@ -53,7 +53,7 @@ func postgresSetup(db *sql.DB) error {
|
|
|
}
|
|
|
|
|
|
row = db.QueryRow(`SELECT 'AddressesDeviceIDSeenIndex'::regclass`)
|
|
|
- if err := row.Scan(nil); err != nil {
|
|
|
+ if err = row.Scan(nil); err != nil {
|
|
|
_, err = db.Exec(`CREATE INDEX AddressesDeviceIDSeenIndex ON Addresses (DeviceID, Seen)`)
|
|
|
}
|
|
|
if err != nil {
|
|
|
@@ -61,7 +61,7 @@ func postgresSetup(db *sql.DB) error {
|
|
|
}
|
|
|
|
|
|
row = db.QueryRow(`SELECT 'AddressesDeviceIDAddressIndex'::regclass`)
|
|
|
- if err := row.Scan(nil); err != nil {
|
|
|
+ if err = row.Scan(nil); err != nil {
|
|
|
_, err = db.Exec(`CREATE INDEX AddressesDeviceIDAddressIndex ON Addresses (DeviceID, Address)`)
|
|
|
}
|
|
|
if err != nil {
|