Here's the process you should follow to achieve what you want:
- Create a new table named
OldTable
with the updated schema
- Create a function named
Table
(should be exact name as your original table) that will return union (OldTable | project id = tolong(id), name), (Table | project id = tolong(id), name)
- this way, whenever someone writes Table
, he'll call the function that will return data from both tables in the correct schema
- Swap
Table
and OldTable
- When the data in the
OldTable
table ages out (at the end of the retention period), it will become empty, and you'll have to first delete the Table
function, then the OldTable
table
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…