{"id":20601204,"url":"https://github.com/cleverage/play-morphia-evolutions","last_synced_at":"2025-03-06T16:18:54.313Z","repository":{"id":5759016,"uuid":"6971931","full_name":"cleverage/play-morphia-evolutions","owner":"cleverage","description":"Adaptation of the PlayFramework evolutions mechanism for Morphia","archived":false,"fork":false,"pushed_at":"2012-12-14T08:44:38.000Z","size":2520,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":8,"default_branch":"master","last_synced_at":"2025-01-17T01:46:31.716Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cleverage.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2012-12-02T20:34:16.000Z","updated_at":"2014-04-08T05:59:58.000Z","dependencies_parsed_at":"2022-08-29T03:42:02.021Z","dependency_job_id":null,"html_url":"https://github.com/cleverage/play-morphia-evolutions","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cleverage%2Fplay-morphia-evolutions","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cleverage%2Fplay-morphia-evolutions/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cleverage%2Fplay-morphia-evolutions/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cleverage%2Fplay-morphia-evolutions/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cleverage","download_url":"https://codeload.github.com/cleverage/play-morphia-evolutions/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":242241246,"owners_count":20095339,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-16T09:09:01.252Z","updated_at":"2025-03-06T16:18:54.280Z","avatar_url":"https://github.com/cleverage.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Play Morphia Evolutions\n\n## Overview\nThis module is an adaptation of the native Play 1.2 Evolutions for Morphia.\n\nIt allows to manage evolution scripts (with \"up\" and \"down\" statements) and automatically checks if your database is up-to-date regarding this evolutions. If it is not the case, scripts can be applied :\n\n- from the browser in dev mode\n- via a dedicated command in prod mode\n\n## Installation\n\nAdd the dependency for this module in your application `conf/dependencies.yml`\n\n\trequire:\n\t    - play\n\t    - play -\u003e morphia 1.2.9\n\t    - morphiaevolutions -\u003e morphiaevolutions 0.2\n\t\n\trepositories:\n\t    - morphiaevolutions:\n\t        type: http\n\t        artifact: https://github.com/cleverage/play-morphia-evolutions/raw/master/dist/[module]-[revision].zip\n\t        containts:\n\t            - morphiaevolutions -\u003e *\n  \nThen retrieve the module using\n\n\tplay deps --sync\n\nBy default, evolutions are enabled in the plugin. If you want to disable evolutions, you can update your `conf/application.conf` :\n\n\tmorphia.evolutions.enabled=false\n\t\n## Usage\n\nOnce the module is installed, you can create evolution scripts in the directory `db/evolutions`\n\nEvolution scripts should be name `1.js`, `2.js`,… in the order you want your evolutions to be applied.\n\nThe syntax of these scripts is quite similar to the standard Play evolution scripts syntax. Ex : \n\n\t// Initializing Foo data\n\t// --- !Ups\n\t\n\tdb.foo.insert({a: 1})\n\t\n\t// --- !Downs\n\t\n\tdb.foo.remove({a: 1})\t\n\t\nYou can then check your database state using the `morphiaevolutions` command:\n\n\t$ play morphiaevolutions\n\t~        _            _ \n\t~  _ __ | | __ _ _  _| |\n\t~ | '_ \\| |/ _' | || |_|\n\t~ |  __/|_|\\____|\\__ (_)\n\t~ |_|            |__/   \n\t~\n\t~ play! 1.2.5, http://www.playframework.org\n\t~\n\t~ Application revision is 1 [432895f] and Database revision is 0 [da39a3e]\n\t~\n\t~ Your database needs evolutions!\n\t\n\t# ------------------------------------------------------------------------------\n\t\n\t// --- Rev:1,Ups - 432895f\n\t\n\t  db.foo.insert({a: 1})\n\t\n\t# ------------------------------------------------------------------------------\n\t\n\t~ Run `play morphiaevolutions:apply` to automatically apply this script to the database\n\t~ or apply it yourself and mark it done using `play morphiaevolutions:markApplied`\n\t~\n\t\nIn dev mode, if you launch your app using `play run` you will see this in your browser.\n\nThe other command `apply`, `markApplied`, `resolve` works as their standard Play evolutions equivalents. see [Play evolutions documentation](http://www.playframework.org/documentation/1.2.5/evolutions).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcleverage%2Fplay-morphia-evolutions","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcleverage%2Fplay-morphia-evolutions","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcleverage%2Fplay-morphia-evolutions/lists"}