-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ft: change data type change for chainid
- Loading branch information
1 parent
1b02c76
commit dc96ec9
Showing
3 changed files
with
47 additions
and
2 deletions.
There are no files selected for viewing
45 changes: 45 additions & 0 deletions
45
backend/migrations/20241126170930-change-chain-id-to-bigint.cjs
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,45 @@ | ||
require('dotenv').config(); | ||
const { DataTypes } = require('sequelize'); | ||
|
||
async function up({ context: queryInterface }) { | ||
await queryInterface.changeColumn( | ||
{schema: process.env.DATABASE_SCHEMA_NAME, tableName: 'sponsorship_policies'}, | ||
'ENABLED_CHAINS', | ||
{ | ||
type: DataTypes.ARRAY(DataTypes.BIGINT), | ||
allowNull: true | ||
} | ||
); | ||
|
||
await queryInterface.changeColumn( | ||
{schema: process.env.DATABASE_SCHEMA_NAME, tableName: 'contract_whitelist'}, | ||
'CHAIN_ID', | ||
{ | ||
type: DataTypes.BIGINT, | ||
allowNull: false | ||
} | ||
); | ||
} | ||
|
||
async function down({ context: queryInterface }) { | ||
await queryInterface.changeColumn( | ||
{schema: process.env.DATABASE_SCHEMA_NAME, tableName: 'sponsorship_policies'}, | ||
'ENABLED_CHAINS', | ||
{ | ||
type: DataTypes.ARRAY(DataTypes.INTEGER), | ||
allowNull: true | ||
} | ||
); | ||
|
||
await queryInterface.changeColumn( | ||
{schema: process.env.DATABASE_SCHEMA_NAME, tableName: 'contract_whitelist'}, | ||
'CHAIN_ID', | ||
{ | ||
type: DataTypes.INTEGER, | ||
allowNull: false | ||
} | ||
); | ||
} | ||
|
||
/** @type {import('sequelize-cli').Migration} */ | ||
module.exports = {up, down}; |
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
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