Code Monkey home page Code Monkey logo

mtmigration's People

Contributors

ajmccall avatar arvkon avatar atomkirk avatar chocochipset avatar clafou avatar fechu avatar hermanolsson avatar pwightman avatar vikfroberg avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

mtmigration's Issues

Adding a hasAppBeenUpdated property

I came across the following scenario:

I have a cache file that I would like to flush on every app update. With the current implementation MTMigration it currently looks like:

[MTMigration applicationUpdateBlock:^{
    flushCache();
}];

if (isCacheAvailable) {    // (1)
    loadCache();
} else {
    writeCache();
}

However, unless a synchronization method is introduced, there is no guarantee that the cache file will be flushed before (1).

Adding a hasAppBeenUpdated property would allow the synchronous execution of code in an easier way:

if (isCacheAvailable && 
    [MTMigration hasAppBeenUpdated] == NO) {
    loadCache();
} else {
    writeCache();
}

Let me know what you think, @pwightman

Cannot build by Carthage

=====================Cartfile ====================
github "mysterioustrousers/MTMigration"

=====================Run "carthage update" ====================
*** Fetching MTMigration
*** Checking out MTMigration at "0.0.5"
*** xcodebuild output can be found in /var/folders/m9/wv055crx2l1c8ttcy2vtl8_40000gn/T/carthage-xcodebuild.lFesDL.log
*** Skipped building MTMigration due to the error:
Dependency "MTMigration" has no shared framework schemes

Want completion block

Sorry for my english.

I'm using [MTMigration applicationUpdateBlock]. I want to indicate migrating progress to user. I think when fixed by additional completionBlock. Are there plans to add such a function?

Differentiate between upgrade and new install

A common use case for me is to distinguish new installs from updates. Often I need to correct something in the database of old users, but don't touch it for fresh installs (because it's fixed out of the box for them).

Perhaps something like this would make sense:

[MTMigration migrateToVersion:@"1.1" block:^{
    if([[MTMigration firstVersionKnownOnThisDevice] isEqualToString:@"1.1"]) {
        // Treat new users differently
    }
    [obj doSomeDataStuff];
}];

I try to avoid this situation; if often happens when you ship some initial data with the app and the app doesn't sync with a server.

Block for version update

It would be handy to have a method where you can set a block that is executed on every Application Update. So everytime the version string of the application changes.
This would be handy to clean up the application or do other stuff that needs to be done on every update.

I need this functionality. So I'll implement it.

Do you think it would be worth that this functionality is part of the repo?

Swift Package Manager

Hello, I've been using MTMigration for years (and contributed to an early version) but now that Swift Package Manager exists I would very much like a SwiftPM version instead of integrating it with CocoaPods.

Until then I have ported a subset to Swift as a drop-in replacement and made it into a Swift Package: https://github.com/Clafou/Migration

From which version is not specified

If i need to migrate from lets say 1.0 to 1.1 and i would use your method migrateToVersion:block: with the parameter @"1.1" for the version, than the block would be executed if the current Version is 1.1 no matter if there was an old version installed. And the block would get executed if the app version is higher. For example if the initial install of the user is 2.0 than the block would get executed.

Please correct me if i am wrong.

Best regards.

Main thread

Why not just run the block in the thread the method was called on?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.