5757from sqlmesh .utils import major_minor , random_id
5858from sqlmesh .utils .date import TimeLike , now_timestamp , time_like_to_str
5959from sqlmesh .utils .errors import SQLMeshError
60+ from sqlmesh .utils .migration import blob_text_type , index_text_type
6061
6162logger = logging .getLogger (__name__ )
6263
@@ -103,17 +104,20 @@ def __init__(
103104 self .plan_dags_table = exp .table_ ("_plan_dags" , db = self .schema )
104105 self .versions_table = exp .table_ ("_versions" , db = self .schema )
105106
107+ index_type = index_text_type (self .engine_adapter .dialect )
108+ blob_type = blob_text_type (self .engine_adapter .dialect )
109+
106110 self ._snapshot_columns_to_types = {
107- "name" : exp .DataType .build ("text" ),
108- "identifier" : exp .DataType .build ("text" ),
109- "version" : exp .DataType .build ("text" ),
110- "snapshot" : exp .DataType .build ("text" ),
111- "kind_name" : exp .DataType .build ("text" ),
111+ "name" : exp .DataType .build (index_type ),
112+ "identifier" : exp .DataType .build (index_type ),
113+ "version" : exp .DataType .build (index_type ),
114+ "snapshot" : exp .DataType .build (blob_type ),
115+ "kind_name" : exp .DataType .build (index_type ),
112116 }
113117
114118 self ._environment_columns_to_types = {
115- "name" : exp .DataType .build ("text" ),
116- "snapshots" : exp .DataType .build ("text" ),
119+ "name" : exp .DataType .build (index_type ),
120+ "snapshots" : exp .DataType .build (blob_type ),
117121 "start_at" : exp .DataType .build ("text" ),
118122 "end_at" : exp .DataType .build ("text" ),
119123 "plan_id" : exp .DataType .build ("text" ),
@@ -125,17 +129,17 @@ def __init__(
125129 }
126130
127131 self ._seed_columns_to_types = {
128- "name" : exp .DataType .build ("text" ),
129- "identifier" : exp .DataType .build ("text" ),
130- "content" : exp .DataType .build ("text" ),
132+ "name" : exp .DataType .build (index_type ),
133+ "identifier" : exp .DataType .build (index_type ),
134+ "content" : exp .DataType .build (blob_type ),
131135 }
132136
133137 self ._interval_columns_to_types = {
134- "id" : exp .DataType .build ("text" ),
138+ "id" : exp .DataType .build (index_type ),
135139 "created_ts" : exp .DataType .build ("bigint" ),
136- "name" : exp .DataType .build ("text" ),
137- "identifier" : exp .DataType .build ("text" ),
138- "version" : exp .DataType .build ("text" ),
140+ "name" : exp .DataType .build (index_type ),
141+ "identifier" : exp .DataType .build (index_type ),
142+ "version" : exp .DataType .build (index_type ),
139143 "start_ts" : exp .DataType .build ("bigint" ),
140144 "end_ts" : exp .DataType .build ("bigint" ),
141145 "is_dev" : exp .DataType .build ("boolean" ),
0 commit comments