Voyager: Install on old website

Created on 25 Sep 2017  路  8Comments  路  Source: the-control-group/voyager

  • Laravel Version: 5.5.13
  • Voyager Version: 1.0
  • Database Driver & Version: Mysql 8.0

Description:

I wanna install voyager on an old Laravel website without some tables like posts cause I already have it when I delete the voyager posts migration this error shown:
[Doctrine\DBAL\Schema\SchemaException] There is no column with name 'excerpt' on table 'posts'.

  • can you guys delete unnecessary tables?
question

Most helpful comment

I think this could be solved by adding a (maybe configurable) prefix to the database tables. This way, naming collisions are less likely to occur.

I'm in the same boat as people here, trying to add voyager to an existing project, but already have a "categories" table. I'm going to change my categories table name just so I can use Voyager.

All 8 comments

I'm not sure exactly what you're asking. More information would certainly be helpful.

It sounds to me like you're asking how to remove tables/models/etc that you don't need. That will depend on which one you don't need. You will need to do more than just delete the migration. Specifically (for Posts):

  1. https://github.com/the-control-group/voyager/blob/master/publishable/database/seeds/DataRowsTableSeeder.php#L14 (and references to it)
  2. https://github.com/the-control-group/voyager/blob/master/publishable/database/seeds/DataTypesTableSeeder.php#L13
  3. https://github.com/the-control-group/voyager/blob/master/publishable/database/seeds/PostsTableSeeder.php (and references to it in VoyagerDummyDatabaseSeeder)
  4. https://github.com/the-control-group/voyager/blob/master/publishable/config/voyager.php#L170

(and probably a few more, but this should be a good start for you.

I should also mention that we're planning to move the Pages/Posts/Categories functionality into a Hook in an upcoming release.

This issue should be open again. You didn't think about adding admin panel to existing project. There is no need for categories. posts and pages tables. Indeed you have bug. I have categories table in my project so when i try to php artisan voyager:install it even doesn't proceed, because of error. (table categories already exists).

@rahimlis, we did think about installing on existing sites. artisan voyager:install is intended for new installs, but MAY work for existing sites. We can't make Voyager predict every possible use-case, and expecting it to do so would be ludicrous. If you do something a non-standard way, or expect the package to work around what you already have (or other packages you're using), then you should also expect to have to do a bit of manual customization to make it work. I agree that it would be nice to document these steps in our docs, but we just haven't had the time to put it there yet. The docs are through readme.io, which allows for suggested edits, so feel free to go contribute.

In short, no, this is not a bug. If you need to install on top of an existing site and run into table name/model collisions, then just open up the Install command and run the steps manually, making changes as necessary.

@fletch3555 what if we added --exclude and --include flags to do so without the need to open the install command file

You only need to open the command file because it's not currently in the docs. That's a temporary workaround. However the manual process won't change. There are too many inter-dependencies right now for us to build the include/exclude flags.

I can say that the biggest overlap we've seen is pages/posts/categories, which were only added as part of the original release in order to show how Voyager can work. For all intents and purposes, they're demo data and not critical to the core functionality of Voyager. We're working on pulling them out into a hook in order to simplify the core functionality.

Your library is really awesome and indeed is the missing admin panel for laravel. I will do my best to contribute for prosperity of it.

I think this could be solved by adding a (maybe configurable) prefix to the database tables. This way, naming collisions are less likely to occur.

I'm in the same boat as people here, trying to add voyager to an existing project, but already have a "categories" table. I'm going to change my categories table name just so I can use Voyager.

This issue has been automatically locked since there has not been any recent activity after it was closed. If you have further questions please ask in our Slack group.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

craigb88 picture craigb88  路  3Comments

TXRRNT picture TXRRNT  路  3Comments

raoasifraza1 picture raoasifraza1  路  3Comments

zzpwestlife picture zzpwestlife  路  3Comments

MikadoInfo picture MikadoInfo  路  3Comments