appwrite / sdk-for-cli

[READ-ONLY] Official Appwrite CLI >_
BSD 3-Clause "New" or "Revised" License
89 stars 27 forks source link

Feature Request:- cloning of projects, databases and collections #42

Open rohankm opened 2 years ago

rohankm commented 2 years ago

Adding more user/developer-friendly functions like cloning would be helpful

The current approach for cloning a project is is

  1. init the database
  2. init the collection
  3. create a new project
  4. manually edit the project id and project name inside appwrite.json to the new project
  5. deploy the collection

which a beginner developer might feel overhead..

what I suggest is a simple clone feature which can clone projects, databases and collections... This can be implemented as

appwrite clone --projectId myProject --cloneProjectId myProjectClone --cloneProjectName MyprojectClone

codercatdev commented 1 year ago

Love this, I was just running into this myself! I like creating projectId same as projectName most of the time.

My expecation of running appwrite deploy collection would offer to create project, then offer to create db as well.

{
    "projectId": "dubstep-stack",
    "projectName": "dubstep-stack",
    "collections": [
        {
            "$id": "notes",
            "$createdAt": "2022-10-14T11:24:26.880+00:00",
            "$updatedAt": "2022-10-14T11:24:39.876+00:00",
            "$permissions": [],
            "databaseId": "dubstep-stack-db",
            "name": "notes",
            "enabled": true,
            "documentSecurity": true,
            "attributes": [
                {
                    "key": "title",
                    "type": "string",
                    "status": "available",
                    "required": true,
                    "array": false,
                    "size": 255,
                    "default": null
                },
                {
                    "key": "body",
                    "type": "string",
                    "status": "available",
                    "required": false,
                    "array": false,
                    "size": 65535,
                    "default": null
                },
                {
                    "key": "profile_id",
                    "type": "string",
                    "status": "available",
                    "required": true,
                    "array": false,
                    "size": 16,
                    "default": null
                }
            ],
            "indexes": []
        }
    ]
}