WIP: migrations demo

This commit is contained in:
John Estropia
2020-09-08 09:09:36 +09:00
parent 8d7f282743
commit 2bbf6b34ea
16 changed files with 199 additions and 16 deletions

View File

@@ -0,0 +1,10 @@
//
// Demo
// Copyright © 2020 John Rommel Estropia, Inc. All rights reserved.
// MARK: - Advanced
/**
Sample application of complex use cases
*/
enum Advanced {}

View File

@@ -0,0 +1,5 @@
//
// Demo
// Copyright © 2020 John Rommel Estropia, Inc. All rights reserved.
import Foundation

View File

@@ -0,0 +1,27 @@
//
// Demo
// Copyright © 2020 John Rommel Estropia, Inc. All rights reserved.
import UIKit
import CoreStore
// MARK: - Advanced.EvolutionDemo
extension Advanced.EvolutionDemo {
// MARK: - Advanced.EvolutionDemo.CreatureV1
final class CreatureV1: CoreStoreObject {
// MARK: Internal
@Field.Stored("dnaCode")
var dnaCode: Int64 = 0
@Field.Stored("hasHead")
var hasHead: Bool = false
@Field.Stored("hasTail")
var hasTail: Bool = false
}
}

View File

@@ -0,0 +1,8 @@
//
// Advanced.Evolution.CreatureV2.swift
// Demo
//
// Created by John Rommel Estropia on 2020/09/06.
//
import Foundation

View File

@@ -0,0 +1,8 @@
//
// Advanced.Evolution.CreatureV3.swift
// Demo
//
// Created by John Rommel Estropia on 2020/09/06.
//
import Foundation

View File

@@ -0,0 +1,8 @@
//
// Advanced.Evolution.CreatureV4.swift
// Demo
//
// Created by John Rommel Estropia on 2020/09/06.
//
import Foundation

View File

@@ -0,0 +1,5 @@
//
// Demo
// Copyright © 2020 John Rommel Estropia, Inc. All rights reserved.
import Foundation

View File

@@ -0,0 +1,5 @@
//
// Demo
// Copyright © 2020 John Rommel Estropia, Inc. All rights reserved.
import Foundation

View File

@@ -0,0 +1,5 @@
//
// Demo
// Copyright © 2020 John Rommel Estropia, Inc. All rights reserved.
import Foundation

View File

@@ -0,0 +1,23 @@
//
// Demo
// Copyright © 2020 John Rommel Estropia, Inc. All rights reserved.
// MARK: - Advanced
extension Advanced {
// MARK: - Advanced.EvolutionDemo
/**
Sample execution of progressive migrations. This demo also supports backwards migration.
*/
enum EvolutionDemo: CaseIterable {
// MARK: Internal
case ageOfInvertebrates
case ageOfFishes
case ageOfReptiles
case ageOfMammals
}
}