Skip to content

Commit 44ce38e

Browse files
author
Zoran Cvetkov
committed
generate POI VIDs too
1 parent 714c931 commit 44ce38e

File tree

2 files changed

+6
-18
lines changed

2 files changed

+6
-18
lines changed

store/postgres/src/relational/ddl.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ impl Table {
116116
Ok(cols)
117117
}
118118

119-
let vid_type = if self.object.is_poi() || !self.object.is_object_type() {
119+
let vid_type = if !self.object.is_object_type() {
120120
"bigserial"
121121
} else {
122122
"bigint"

store/postgres/src/relational_queries.rs

Lines changed: 5 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2541,8 +2541,6 @@ impl<'a> QueryFragment<Pg> for InsertQuery<'a> {
25412541
let out = &mut out;
25422542
out.unsafe_to_cache_prepared();
25432543

2544-
let not_poi = !self.table.object.is_poi();
2545-
25462544
// Construct a query
25472545
// insert into schema.table(column, ...)
25482546
// values
@@ -2568,9 +2566,7 @@ impl<'a> QueryFragment<Pg> for InsertQuery<'a> {
25682566
out.push_sql(CAUSALITY_REGION_COLUMN);
25692567
};
25702568

2571-
if not_poi {
2572-
out.push_sql(", vid");
2573-
}
2569+
out.push_sql(", vid");
25742570
out.push_sql(") values\n");
25752571

25762572
for (i, row) in self.rows.iter().enumerate() {
@@ -2588,10 +2584,8 @@ impl<'a> QueryFragment<Pg> for InsertQuery<'a> {
25882584
out.push_sql(", ");
25892585
out.push_bind_param::<Integer, _>(&row.causality_region)?;
25902586
};
2591-
if not_poi {
2592-
out.push_sql(", ");
2593-
out.push_bind_param::<BigInt, _>(&row.vid)?;
2594-
}
2587+
out.push_sql(", ");
2588+
out.push_bind_param::<BigInt, _>(&row.vid)?;
25952589
out.push_sql(")");
25962590
}
25972591

@@ -5089,8 +5083,6 @@ impl<'a> QueryFragment<Pg> for CopyEntityBatchQuery<'a> {
50895083
fn walk_ast<'b>(&'b self, mut out: AstPass<'_, 'b, Pg>) -> QueryResult<()> {
50905084
out.unsafe_to_cache_prepared();
50915085

5092-
let not_poi = !self.dst.object.is_poi();
5093-
50945086
// Construct a query
50955087
// insert into {dst}({columns})
50965088
// select {columns} from {src}
@@ -5111,9 +5103,7 @@ impl<'a> QueryFragment<Pg> for CopyEntityBatchQuery<'a> {
51115103
out.push_sql(", ");
51125104
out.push_sql(CAUSALITY_REGION_COLUMN);
51135105
};
5114-
if not_poi {
5115-
out.push_sql(", vid");
5116-
}
5106+
out.push_sql(", vid");
51175107

51185108
out.push_sql(")\nselect ");
51195109
for column in &self.columns {
@@ -5179,9 +5169,7 @@ impl<'a> QueryFragment<Pg> for CopyEntityBatchQuery<'a> {
51795169
));
51805170
}
51815171
}
5182-
if not_poi {
5183-
out.push_sql(", vid");
5184-
}
5172+
out.push_sql(", vid");
51855173

51865174
out.push_sql(" from ");
51875175
out.push_sql(self.src.qualified_name.as_str());

0 commit comments

Comments
 (0)