Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
ozym committed Nov 22, 2024
1 parent 03f31b0 commit c8e9e43
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
1 change: 0 additions & 1 deletion meta/sqlite/db.go
Original file line number Diff line number Diff line change
Expand Up @@ -358,7 +358,6 @@ func (d DB) Init(ctx context.Context, list []meta.TableList) error {
if err := d.exec(ctx, tx, gain.Create); err != nil {
return err
}
log.Println(gain.Insert)
if err := d.prepare(ctx, tx, gain.Insert, gain.Columns(l)...); err != nil {
return err
}
Expand Down
4 changes: 2 additions & 2 deletions meta/sqlite/rework.go
Original file line number Diff line number Diff line change
Expand Up @@ -720,7 +720,6 @@ CREATE TABLE IF NOT EXISTS gain (
FOREIGN KEY (site_id) REFERENCES site (site_id),
UNIQUE(site_id, sublocation, subsource, start_date, end_date)
);
CREATE TRIGGER IF NOT EXISTS no_overlap_on_gain BEFORE INSERT ON gain
WHEN EXISTS (
SELECT * FROM gain
Expand All @@ -737,7 +736,8 @@ END;
`

func gainInsert() string {
return fmt.Sprintf("INSERT OR IGNORE INTO gain (site_id, sublocation, subsource, scale_factor, scale_bias, absolute_bias, start_date, end_date) VALUES ((%s), ?, ?, ?, ?, ?, ?, ?);", siteSelect())
//return fmt.Sprintf("INSERT OR IGNORE INTO gain (site_id, sublocation, subsource, scale_factor, scale_bias, absolute_bias, start_date, end_date) VALUES ((%s), ?, ?, ?, ?, ?, ?, ?);", siteSelect())
return fmt.Sprintf("INSERT INTO gain (site_id, sublocation, subsource, scale_factor, scale_bias, absolute_bias, start_date, end_date) VALUES ((%s), ?, ?, ?, ?, ?, ?, ?);", siteSelect())
}

func gainFields() []string {
Expand Down

0 comments on commit c8e9e43

Please sign in to comment.