Skip to content

Bug: php spark migrate:create File -n NameSpace doesn't create migration class under NameSpace/Database/Migrations directory with composer autoload #2664

Description

@samsonasik

Currently, when running migration create for module namespace, eg: Album, while Album namespace already in composer autolaod, it doesn't create the migration class to Album/Database/Migrations directory. Instead, It created file in app/Database/Migrations directory.

It needs manually add 'namespace' to Config/Autoload class under app/Config directory:

		$psr4 = [
			'App'         => APPPATH,                // To ensure filters, etc still found,
			APP_NAMESPACE => APPPATH,                // For custom namespace
			'Config'      => APPPATH . 'Config',
			'Album'       => ROOTPATH . 'modules/Album',
		];

to make it generated to correct Album/Database/Migrations directory, while I think it should not, as Album namespace already in composer.json autoload:

	"autoload": {
		"psr-4": {
			"Album\\": "modules/Album"
		}
	},

CodeIgniter 4 version
4.0.2

Expected behavior, and steps to reproduce if appropriate
It create the migration class to Album/Database/Migrations directory:

Context

  • OS: OSX
  • Web server: Apache
  • PHP version 7.4

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugVerified issues on the current code behavior or pull requests that will fix them

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions