{"id":13481514,"url":"https://github.com/lastland/scala-forklift","last_synced_at":"2025-04-06T10:11:20.242Z","repository":{"id":36676818,"uuid":"40983240","full_name":"lastland/scala-forklift","owner":"lastland","description":"Type-safe data migration tool for Slick, Git and beyond.","archived":false,"fork":false,"pushed_at":"2024-08-19T14:36:15.000Z","size":316,"stargazers_count":188,"open_issues_count":15,"forks_count":31,"subscribers_count":11,"default_branch":"develop","last_synced_at":"2024-10-11T21:52:25.532Z","etag":null,"topics":["database-migrations","scala","slick"],"latest_commit_sha":null,"homepage":"","language":"Scala","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/lastland.png","metadata":{"files":{"readme":"README.markdown","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2015-08-18T16:26:21.000Z","updated_at":"2024-08-19T14:36:19.000Z","dependencies_parsed_at":"2024-10-25T17:34:49.116Z","dependency_job_id":"a5d9f8cb-1cde-490a-8004-c005fd84b04b","html_url":"https://github.com/lastland/scala-forklift","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lastland%2Fscala-forklift","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lastland%2Fscala-forklift/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lastland%2Fscala-forklift/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lastland%2Fscala-forklift/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lastland","download_url":"https://codeload.github.com/lastland/scala-forklift/tar.gz/refs/heads/develop","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247464222,"owners_count":20942970,"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":["database-migrations","scala","slick"],"created_at":"2024-07-31T17:00:52.439Z","updated_at":"2025-04-06T10:11:20.202Z","avatar_url":"https://github.com/lastland.png","language":"Scala","funding_links":[],"categories":["Table of Contents","Database"],"sub_categories":["Database"],"readme":"# Scala-Forklift\n\n[![Circle CI](https://circleci.com/gh/lastland/scala-forklift.svg?style=shield)](https://circleci.com/gh/lastland/scala-forklift)\n[![Join the chat at https://gitter.im/lastland/scala-forklift](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/lastland/scala-forklift?utm_source=badge\u0026utm_medium=badge\u0026utm_campaign=pr-badge\u0026utm_content=badge)\n\nScala-Forklift helps manage and apply database migrations for your Scala project.\n\nWrite your migrations in plain SQL:\n\n```scala\nMyMigrations.migrations = MyMigrations.migrations :+ SqlMigration(1)(List(\n  sqlu\"\"\"create table \"users\" (\"id\" INTEGER NOT NULL PRIMARY KEY,\"first\" VARCHAR NOT NULL,\"last\" VARCHAR NOT NULL)\"\"\"\n))\n```\n\nOr type-safe Slick queries:\n\n``` scala\nMyMigrations.migrations = MyMigrations.migrations :+ DBIOMigration(2)(\n  DBIO.seq(Users ++= Seq(\n    UsersRow(1, \"Chris\",\"Vogt\"),\n    UsersRow(2, \"Yao\",\"Li\")\n  )))\n```\n\nOr use [slick-migration-api](https://github.com/nafg/slick-migration-api):\n\n``` scala\nMyMigrations.migrations = MyMigrations.migrations :+ APIMigration(3)(\n  TableMigration(Users).\n    renameColumn(_.first, \"firstname\").\n    renameColumn(_.last, \"lastname\"))\n```\n\n(Note: `APIMigration` is not supported in versions prior to `v0.2.3`)\n\nDon't worry about keeping the Scala code and your database schema consistent. Our source code generator will have it generated for you.\n\n**Key Features**:\n\n- Supports for type-safe database migration with [Slick](https://github.com/slick/slick) and [slick-migration-api](https://github.com/nafg/slick-migration-api).\n- A source code generator to generate and manage Scala models from your database schemas.\n- A tool to help you manage your dev db with git, with supports for branching and merging.\n- High customizability.\n\n\n## How to Use\n\nScala-Forklift supports both Slick 3.1 and Slick 3.2. The latest versions of Scala-Forklift are given below:\n\n| Scala Version  | Slick Version | SBT dependency |\n|----------------|---------------|----------------|\n| 2.11.x         | `3.1.x`       | `libraryDependencies += \"com.liyaos\" %% \"scala-forklift-slick\" % \"0.2.3\"` |\n| 2.12.x, 2.11.x | `3.2.x`       | `libraryDependencies += \"com.liyaos\" %% \"scala-forklift-slick\" % \"0.3.1\"` |\n| 2.13.x, 2.12.x | `3.3.x`       | `libraryDependencies += \"com.liyaos\" %% \"scala-forklift-slick\" % \"0.3.2\"` |\n\nFor tutorial and example code, please check [example](/example).\n\nHere is also a wonderful [tutorial](http://blog.novatec-gmbh.de/database-migration-slick-scala-forklift/) written by Andreas Burkard and Julian Tragé.\n\n### Quick Start\n\nYou can use our start template on GitHub to quickly start a project with Scala-Forklift:\n\n``` shell\ngit clone https://github.com/lastland/scala-forklift-start-template.git\n```\n\n## More Examples\n\n- [Demo with Play and Slick](https://github.com/lastland/play-slick-forklift-example)\n- [Demo with Quill](https://github.com/lastland/scala-forklift-quill)\n\n## Known Issues\n\n- The `reset` command may not correctly handle database schemas with foreign keys.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flastland%2Fscala-forklift","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flastland%2Fscala-forklift","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flastland%2Fscala-forklift/lists"}