Swift: add database migration scripts

This commit is contained in:
Alex Denisov
2023-06-14 11:49:16 +02:00
parent 526f6cd5b5
commit c080cba88d
7 changed files with 10515 additions and 0 deletions

View File

@@ -0,0 +1,36 @@
class Element extends @element {
string toString() { none() }
}
newtype TAddedUnspecifiedElement =
TNonExplicitClosureExprClosureBody(Element list, Element body) {
capture_list_exprs(list, body) and not explicit_closure_exprs(body)
}
module Fresh = QlBuiltins::NewEntity<TAddedUnspecifiedElement>;
class TNewElement = @element or Fresh::EntityId;
class NewElement extends TNewElement {
string toString() { none() }
}
query predicate new_unspecified_elements(NewElement u, string property, string error) {
unspecified_elements(u, property, error)
or
u = Fresh::map(TNonExplicitClosureExprClosureBody(_, _)) and
property = "closure_body" and
error = "while downgrading: closure_body not an @explicit_closure_expr"
}
query predicate new_unspecified_element_parents(NewElement u, Element parent) {
unspecified_element_parents(u, parent)
or
u = Fresh::map(TNonExplicitClosureExprClosureBody(parent, _))
}
query predicate new_capture_list_exprs(Element list, NewElement body) {
capture_list_exprs(list, body) and explicit_closure_exprs(body)
or
body = Fresh::map(TNonExplicitClosureExprClosureBody(list, _))
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,5 @@
description: Revert making closure_body have type @abstract_closure_expr
compatibility: backwards
unspecified_elements.rel: run downgrade.qlo new_unspecified_elements
unspecified_element_parents.rel: run downgrade.qlo new_unspecified_element_parents
capture_list_exprs.rel: run downgrade.qlo new_capture_list_exprs

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,2 @@
description: New entities added
compatibility: full