From 18f0402fb1291fc5598d353f5b8dcdd907b30467 Mon Sep 17 00:00:00 2001 From: Bryan Stitt Date: Wed, 5 Apr 2023 14:36:51 -0700 Subject: [PATCH] null and unique don't play nice --- migration/src/m20230125_204810_stats_v2.rs | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/migration/src/m20230125_204810_stats_v2.rs b/migration/src/m20230125_204810_stats_v2.rs index ef9250e8..6e162ad4 100644 --- a/migration/src/m20230125_204810_stats_v2.rs +++ b/migration/src/m20230125_204810_stats_v2.rs @@ -20,20 +20,31 @@ impl MigrationTrait for Migration { .col( ColumnDef::new(RpcAccountingV2::RpcKeyId) .big_unsigned() - .null(), + .not_null() + .default(0), ) .col( ColumnDef::new(RpcAccountingV2::ChainId) .big_unsigned() .not_null(), ) - .col(ColumnDef::new(RpcAccountingV2::Origin).string().null()) + .col( + ColumnDef::new(RpcAccountingV2::Origin) + .string() + .not_null() + .default(""), + ) .col( ColumnDef::new(RpcAccountingV2::PeriodDatetime) .timestamp() .not_null(), ) - .col(ColumnDef::new(RpcAccountingV2::Method).string().null()) + .col( + ColumnDef::new(RpcAccountingV2::Method) + .string() + .not_null() + .default(""), + ) .col( ColumnDef::new(RpcAccountingV2::ArchiveNeeded) .boolean()