1010from sqlalchemy import ( # type: ignore
1111 BigInteger ,
1212 Column ,
13+ Index ,
1314 LargeBinary ,
1415 MetaData ,
1516 String ,
8283 Column ("project_proto" , LargeBinary , nullable = False ),
8384)
8485
86+ Index ("idx_projects_project_id" , projects .c .project_id )
87+
8588entities = Table (
8689 "entities" ,
8790 metadata ,
9194 Column ("entity_proto" , LargeBinary , nullable = False ),
9295)
9396
97+ Index ("idx_entities_project_id" , entities .c .project_id )
98+
9499data_sources = Table (
95100 "data_sources" ,
96101 metadata ,
100105 Column ("data_source_proto" , LargeBinary , nullable = False ),
101106)
102107
108+ Index ("idx_data_sources_project_id" , data_sources .c .project_id )
109+
103110feature_views = Table (
104111 "feature_views" ,
105112 metadata ,
111118 Column ("user_metadata" , LargeBinary , nullable = True ),
112119)
113120
121+ Index ("idx_feature_views_project_id" , feature_views .c .project_id )
122+
114123stream_feature_views = Table (
115124 "stream_feature_views" ,
116125 metadata ,
121130 Column ("user_metadata" , LargeBinary , nullable = True ),
122131)
123132
133+ Index ("idx_stream_feature_views_project_id" , stream_feature_views .c .project_id )
134+
124135on_demand_feature_views = Table (
125136 "on_demand_feature_views" ,
126137 metadata ,
131142 Column ("user_metadata" , LargeBinary , nullable = True ),
132143)
133144
145+ Index ("idx_on_demand_feature_views_project_id" , on_demand_feature_views .c .project_id )
146+
134147feature_services = Table (
135148 "feature_services" ,
136149 metadata ,
140153 Column ("feature_service_proto" , LargeBinary , nullable = False ),
141154)
142155
156+ Index ("idx_feature_services_project_id" , feature_services .c .project_id )
157+
143158saved_datasets = Table (
144159 "saved_datasets" ,
145160 metadata ,
149164 Column ("saved_dataset_proto" , LargeBinary , nullable = False ),
150165)
151166
167+ Index ("idx_saved_datasets_project_id" , saved_datasets .c .project_id )
168+
152169validation_references = Table (
153170 "validation_references" ,
154171 metadata ,
157174 Column ("last_updated_timestamp" , BigInteger , nullable = False ),
158175 Column ("validation_reference_proto" , LargeBinary , nullable = False ),
159176)
177+ Index ("idx_validation_references_project_id" , validation_references .c .project_id )
160178
161179managed_infra = Table (
162180 "managed_infra" ,
167185 Column ("infra_proto" , LargeBinary , nullable = False ),
168186)
169187
188+ Index ("idx_managed_infra_project_id" , managed_infra .c .project_id )
189+
170190permissions = Table (
171191 "permissions" ,
172192 metadata ,
176196 Column ("permission_proto" , LargeBinary , nullable = False ),
177197)
178198
199+ Index ("idx_permissions_project_id" , permissions .c .project_id )
200+
179201
180202class FeastMetadataKeys (Enum ):
181203 LAST_UPDATED_TIMESTAMP = "last_updated_timestamp"
@@ -191,6 +213,8 @@ class FeastMetadataKeys(Enum):
191213 Column ("last_updated_timestamp" , BigInteger , nullable = False ),
192214)
193215
216+ Index ("idx_feast_metadata_project_id" , feast_metadata .c .project_id )
217+
194218logger = logging .getLogger (__name__ )
195219
196220
0 commit comments