Skip to content

Commit

Permalink
blob instead of binary(1)
Browse files Browse the repository at this point in the history
Signed-off-by: Bugen Zhao <[email protected]>
  • Loading branch information
BugenZhao committed Nov 1, 2024
1 parent 47ce406 commit 22fa07e
Show file tree
Hide file tree
Showing 10 changed files with 40 additions and 50 deletions.
48 changes: 22 additions & 26 deletions src/meta/model/migration/src/m20230908_072257_init.rs
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ impl MigrationTrait for Migration {
.col(ColumnDef::new(User::CanCreateDb).boolean().not_null())
.col(ColumnDef::new(User::CanCreateUser).boolean().not_null())
.col(ColumnDef::new(User::CanLogin).boolean().not_null())
.col(ColumnDef::new(User::AuthInfo).binary())
.col(ColumnDef::new(User::AuthInfo).blob())
.to_owned(),
)
.await?;
Expand Down Expand Up @@ -376,12 +376,8 @@ impl MigrationTrait for Migration {
.string()
.not_null(),
)
.col(
ColumnDef::new(Fragment::StreamNode)
.blob(BlobSize::Long)
.not_null(),
)
.col(ColumnDef::new(Fragment::VnodeMapping).binary().not_null())
.col(ColumnDef::new(Fragment::StreamNode).blob().not_null())
.col(ColumnDef::new(Fragment::VnodeMapping).blob().not_null())
.col(ColumnDef::new(Fragment::StateTableIds).json_binary())
.col(ColumnDef::new(Fragment::UpstreamFragmentId).json_binary())
.foreign_key(
Expand All @@ -407,12 +403,12 @@ impl MigrationTrait for Migration {
)
.col(ColumnDef::new(Actor::FragmentId).integer().not_null())
.col(ColumnDef::new(Actor::Status).string().not_null())
.col(ColumnDef::new(Actor::Splits).binary())
.col(ColumnDef::new(Actor::Splits).blob())
.col(ColumnDef::new(Actor::ParallelUnitId).integer().not_null())
.col(ColumnDef::new(Actor::WorkerId).integer().not_null())
.col(ColumnDef::new(Actor::UpstreamActorIds).json_binary())
.col(ColumnDef::new(Actor::VnodeBitmap).binary())
.col(ColumnDef::new(Actor::ExprContext).binary().not_null())
.col(ColumnDef::new(Actor::VnodeBitmap).blob())
.col(ColumnDef::new(Actor::ExprContext).blob().not_null())
.foreign_key(
&mut ForeignKey::create()
.name("FK_actor_fragment_id")
Expand Down Expand Up @@ -454,7 +450,7 @@ impl MigrationTrait for Migration {
.json_binary()
.not_null(),
)
.col(ColumnDef::new(ActorDispatcher::HashMapping).binary())
.col(ColumnDef::new(ActorDispatcher::HashMapping).blob())
.col(
ColumnDef::new(ActorDispatcher::DispatcherId)
.integer()
Expand Down Expand Up @@ -495,7 +491,7 @@ impl MigrationTrait for Migration {
.primary_key(),
)
.col(ColumnDef::new(Connection::Name).string().not_null())
.col(ColumnDef::new(Connection::Info).binary().not_null())
.col(ColumnDef::new(Connection::Info).blob().not_null())
.foreign_key(
&mut ForeignKey::create()
.name("FK_connection_object_id")
Expand All @@ -514,16 +510,16 @@ impl MigrationTrait for Migration {
.col(ColumnDef::new(Source::SourceId).integer().primary_key())
.col(ColumnDef::new(Source::Name).string().not_null())
.col(ColumnDef::new(Source::RowIdIndex).integer())
.col(ColumnDef::new(Source::Columns).binary().not_null())
.col(ColumnDef::new(Source::Columns).blob().not_null())
.col(ColumnDef::new(Source::PkColumnIds).json_binary().not_null())
.col(
ColumnDef::new(Source::WithProperties)
.json_binary()
.not_null(),
)
.col(ColumnDef::new(Source::Definition).text().not_null())
.col(ColumnDef::new(Source::SourceInfo).binary())
.col(ColumnDef::new(Source::WatermarkDescs).binary().not_null())
.col(ColumnDef::new(Source::SourceInfo).blob())
.col(ColumnDef::new(Source::WatermarkDescs).blob().not_null())
.col(ColumnDef::new(Source::OptionalAssociatedTableId).integer())
.col(ColumnDef::new(Source::ConnectionId).integer())
.col(ColumnDef::new(Source::Version).big_integer().not_null())
Expand Down Expand Up @@ -562,8 +558,8 @@ impl MigrationTrait for Migration {
.col(ColumnDef::new(Table::OptionalAssociatedSourceId).integer())
.col(ColumnDef::new(Table::TableType).string().not_null())
.col(ColumnDef::new(Table::BelongsToJobId).integer())
.col(ColumnDef::new(Table::Columns).binary().not_null())
.col(ColumnDef::new(Table::Pk).binary().not_null())
.col(ColumnDef::new(Table::Columns).blob().not_null())
.col(ColumnDef::new(Table::Pk).blob().not_null())
.col(
ColumnDef::new(Table::DistributionKey)
.json_binary()
Expand Down Expand Up @@ -593,14 +589,14 @@ impl MigrationTrait for Migration {
)
.col(ColumnDef::new(Table::DistKeyInPk).json_binary().not_null())
.col(ColumnDef::new(Table::DmlFragmentId).integer())
.col(ColumnDef::new(Table::Cardinality).binary())
.col(ColumnDef::new(Table::Cardinality).blob())
.col(
ColumnDef::new(Table::CleanedByWatermark)
.boolean()
.not_null(),
)
.col(ColumnDef::new(Table::Description).string())
.col(ColumnDef::new(Table::Version).binary())
.col(ColumnDef::new(Table::Version).blob())
.col(ColumnDef::new(Table::RetentionSeconds).integer())
.col(
ColumnDef::new(Table::IncomingSinks)
Expand Down Expand Up @@ -655,8 +651,8 @@ impl MigrationTrait for Migration {
.table(Sink::Table)
.col(ColumnDef::new(Sink::SinkId).integer().primary_key())
.col(ColumnDef::new(Sink::Name).string().not_null())
.col(ColumnDef::new(Sink::Columns).binary().not_null())
.col(ColumnDef::new(Sink::PlanPk).binary().not_null())
.col(ColumnDef::new(Sink::Columns).blob().not_null())
.col(ColumnDef::new(Sink::PlanPk).blob().not_null())
.col(
ColumnDef::new(Sink::DistributionKey)
.json_binary()
Expand All @@ -669,7 +665,7 @@ impl MigrationTrait for Migration {
.col(ColumnDef::new(Sink::ConnectionId).integer())
.col(ColumnDef::new(Sink::DbName).string().not_null())
.col(ColumnDef::new(Sink::SinkFromName).string().not_null())
.col(ColumnDef::new(Sink::SinkFormatDesc).binary())
.col(ColumnDef::new(Sink::SinkFormatDesc).blob())
.col(ColumnDef::new(Sink::TargetTable).integer())
.foreign_key(
&mut ForeignKey::create()
Expand Down Expand Up @@ -704,7 +700,7 @@ impl MigrationTrait for Migration {
.col(ColumnDef::new(View::Name).string().not_null())
.col(ColumnDef::new(View::Properties).json_binary().not_null())
.col(ColumnDef::new(View::Definition).text().not_null())
.col(ColumnDef::new(View::Columns).binary().not_null())
.col(ColumnDef::new(View::Columns).blob().not_null())
.foreign_key(
&mut ForeignKey::create()
.name("FK_view_object_id")
Expand All @@ -724,7 +720,7 @@ impl MigrationTrait for Migration {
.col(ColumnDef::new(Index::Name).string().not_null())
.col(ColumnDef::new(Index::IndexTableId).integer().not_null())
.col(ColumnDef::new(Index::PrimaryTableId).integer().not_null())
.col(ColumnDef::new(Index::IndexItems).binary().not_null())
.col(ColumnDef::new(Index::IndexItems).blob().not_null())
.col(ColumnDef::new(Index::IndexColumnsLen).integer().not_null())
.foreign_key(
&mut ForeignKey::create()
Expand Down Expand Up @@ -760,8 +756,8 @@ impl MigrationTrait for Migration {
.col(ColumnDef::new(Function::FunctionId).integer().primary_key())
.col(ColumnDef::new(Function::Name).string().not_null())
.col(ColumnDef::new(Function::ArgNames).string().not_null())
.col(ColumnDef::new(Function::ArgTypes).binary().not_null())
.col(ColumnDef::new(Function::ReturnType).binary().not_null())
.col(ColumnDef::new(Function::ArgTypes).blob().not_null())
.col(ColumnDef::new(Function::ReturnType).blob().not_null())
.col(ColumnDef::new(Function::Language).string().not_null())
.col(ColumnDef::new(Function::Link).string())
.col(ColumnDef::new(Function::Identifier).string())
Expand Down
12 changes: 4 additions & 8 deletions src/meta/model/migration/src/m20231008_020431_hummock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,7 @@ impl MigrationTrait for Migration {
.not_null()
.primary_key(),
)
.col(
ColumnDef::new(CompactionTask::Task)
.blob(BlobSize::Long)
.not_null(),
)
.col(ColumnDef::new(CompactionTask::Task).blob().not_null())
.col(
ColumnDef::new(CompactionTask::ContextId)
.integer()
Expand All @@ -54,7 +50,7 @@ impl MigrationTrait for Migration {
.not_null()
.primary_key(),
)
.col(ColumnDef::new(CompactionConfig::Config).blob(BlobSize::Long))
.col(ColumnDef::new(CompactionConfig::Config).blob())
.to_owned(),
)
.await?;
Expand All @@ -69,7 +65,7 @@ impl MigrationTrait for Migration {
.not_null()
.primary_key(),
)
.col(ColumnDef::new(CompactionStatus::Status).blob(BlobSize::Long))
.col(ColumnDef::new(CompactionStatus::Status).blob())
.to_owned(),
)
.await?;
Expand Down Expand Up @@ -142,7 +138,7 @@ impl MigrationTrait for Migration {
.boolean()
.not_null(),
)
.col(ColumnDef::new(HummockVersionDelta::FullVersionDelta).blob(BlobSize::Long))
.col(ColumnDef::new(HummockVersionDelta::FullVersionDelta).blob())
.to_owned(),
)
.await?;
Expand Down
4 changes: 2 additions & 2 deletions src/meta/model/migration/src/m20240304_074901_subscription.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ impl MigrationTrait for Migration {
.primary_key(),
)
.col(ColumnDef::new(Subscription::Name).string().not_null())
.col(ColumnDef::new(Subscription::Columns).binary().not_null())
.col(ColumnDef::new(Subscription::PlanPk).binary().not_null())
.col(ColumnDef::new(Subscription::Columns).blob().not_null())
.col(ColumnDef::new(Subscription::PlanPk).blob().not_null())
.col(
ColumnDef::new(Subscription::DistributionKey)
.json_binary()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,8 @@ impl MigrationTrait for Migration {
)
.col(ColumnDef::new(Subscription::Name).string().not_null())
.col(ColumnDef::new(Subscription::Definition).string().not_null())
.col(ColumnDef::new(Subscription::Columns).binary().not_null())
.col(ColumnDef::new(Subscription::PlanPk).binary().not_null())
.col(ColumnDef::new(Subscription::Columns).blob().not_null())
.col(ColumnDef::new(Subscription::PlanPk).blob().not_null())
.col(
ColumnDef::new(Subscription::DistributionKey)
.json_binary()
Expand Down
6 changes: 3 additions & 3 deletions src/meta/model/migration/src/m20240525_090457_secret.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ impl MigrationTrait for Migration {
.primary_key(),
)
.col(ColumnDef::new(Secret::Name).string().not_null())
.col(ColumnDef::new(Secret::Value).binary().not_null())
.col(ColumnDef::new(Secret::Value).blob().not_null())
.foreign_key(
&mut ForeignKey::create()
.name("FK_secret_object_id")
Expand All @@ -42,7 +42,7 @@ impl MigrationTrait for Migration {
.alter_table(
MigrationTable::alter()
.table(Sink::Table)
.add_column(ColumnDef::new(Sink::SecretRef).binary())
.add_column(ColumnDef::new(Sink::SecretRef).blob())
.to_owned(),
)
.await?;
Expand All @@ -52,7 +52,7 @@ impl MigrationTrait for Migration {
.alter_table(
MigrationTable::alter()
.table(Source::Table)
.add_column(ColumnDef::new(Source::SecretRef).binary())
.add_column(ColumnDef::new(Source::SecretRef).blob())
.to_owned(),
)
.await?;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ impl MigrationTrait for Migration {
.alter_table(
Table::alter()
.table(Index::Table)
.add_column(ColumnDef::new(Index::IndexColumnProperties).binary())
.add_column(ColumnDef::new(Index::IndexColumnProperties).blob())
.to_owned(),
)
.await
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ impl MigrationTrait for Migration {
.alter_table(
MigrationTable::alter()
.table(Sink::Table)
.add_column(ColumnDef::new(Sink::OriginalTargetColumns).binary())
.add_column(ColumnDef::new(Sink::OriginalTargetColumns).blob())
.to_owned(),
)
.await?;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,7 @@ impl MigrationTrait for Migration {
.alter_table(
Table::alter()
.table(Function::Table)
.modify_column(
ColumnDef::new(Function::CompressedBinary).blob(BlobSize::Medium),
)
.modify_column(ColumnDef::new(Function::CompressedBinary).blob())
.to_owned(),
)
.await?;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ impl MigrationTrait for Migration {
.alter_table(
Table::alter()
.table(Fragment::Table)
.add_column(ColumnDef::new(Fragment::VnodeMapping).binary().not_null())
.add_column(ColumnDef::new(Fragment::VnodeMapping).blob().not_null())
.to_owned(),
)
.await?;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ impl MigrationTrait for Migration {
)
.col(
ColumnDef::new(HummockSstableInfo::SstableInfo)
.blob(BlobSize::Long)
.blob()
.null(),
)
.to_owned(),
Expand All @@ -46,7 +46,7 @@ impl MigrationTrait for Migration {
)
.col(
ColumnDef::new(HummockTimeTravelVersion::Version)
.blob(BlobSize::Long)
.blob()
.null(),
)
.to_owned(),
Expand All @@ -66,7 +66,7 @@ impl MigrationTrait for Migration {
)
.col(
ColumnDef::new(HummockTimeTravelDelta::VersionDelta)
.blob(BlobSize::Long)
.blob()
.null(),
)
.to_owned(),
Expand Down

0 comments on commit 22fa07e

Please sign in to comment.