-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
36 additions
and
0 deletions.
There are no files selected for viewing
34 changes: 34 additions & 0 deletions
34
pkg/postgres/migrations/202411191550_operatorAVSSplits/up.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
package _202411191550_operatorAVSSplits | ||
|
||
import ( | ||
"database/sql" | ||
|
||
"gorm.io/gorm" | ||
) | ||
|
||
type Migration struct { | ||
} | ||
|
||
func (m *Migration) Up(db *sql.DB, grm *gorm.DB) error { | ||
query := ` | ||
create table if not exists operator_avs_splits ( | ||
operator varchar not null, | ||
avs varchar not null, | ||
activated_at timestamp(6) not null, | ||
old_operator_avs_split_bips integer not null, | ||
new_operator_avs_split_bips integer not null, | ||
block_number bigint not null, | ||
transaction_hash varchar not null, | ||
log_index bigint not null, | ||
unique(transaction_hash, log_index, block_number) | ||
); | ||
` | ||
if err := grm.Exec(query).Error; err != nil { | ||
return err | ||
} | ||
return nil | ||
} | ||
|
||
func (m *Migration) GetName() string { | ||
return "202411191550_operatorAVSSplits" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters