| 289 | return result |
| 290 | |
| 291 | def update( |
| 292 | self, |
| 293 | config: RepoConfig, |
| 294 | tables_to_delete: Sequence[FeatureView], |
| 295 | tables_to_keep: Sequence[FeatureView], |
| 296 | entities_to_delete: Sequence[Entity], |
| 297 | entities_to_keep: Sequence[Entity], |
| 298 | partial: bool, |
| 299 | ): |
| 300 | conn = self._get_conn(config) |
| 301 | project = config.project |
| 302 | |
| 303 | versioning = config.registry.enable_online_feature_view_versioning |
| 304 | for table in tables_to_keep: |
| 305 | conn.execute( |
| 306 | f"CREATE TABLE IF NOT EXISTS {_table_id(project, table, versioning)} (entity_key BLOB, feature_name TEXT, value BLOB, vector_value BLOB, event_ts timestamp, created_ts timestamp, PRIMARY KEY(entity_key, feature_name))" |
| 307 | ) |
| 308 | conn.execute( |
| 309 | f"CREATE INDEX IF NOT EXISTS {_table_id(project, table, versioning)}_ek ON {_table_id(project, table, versioning)} (entity_key);" |
| 310 | ) |
| 311 | |
| 312 | for table in tables_to_delete: |
| 313 | conn.execute( |
| 314 | f"DROP TABLE IF EXISTS {_table_id(project, table, versioning)}" |
| 315 | ) |
| 316 | |
| 317 | def plan( |
| 318 | self, config: RepoConfig, desired_registry_proto: RegistryProto |