Coder Social home page Coder Social logo

Comments (10)

javorszky avatar javorszky commented on August 29, 2024 1

Right, but what the installation steps do not say is that the installation expects a base laravel to be up and running already.

ie these needed to have been run before doing the composer require:

  1. laravel new X
  2. set up creds
  3. php artisan migrate
  4. time passes
  5. composer require wink, etc...

from wink.

 avatar commented on August 29, 2024

Having same issue here, but in my case I did a fresh install laravel project with database connection same as the current. Already doing some check. And I think the problem comes from here:

// wink/src/Console/MigrateCommand.php
$initialMigration = ! Schema::connection(config('wink.database_connection'))->hasTable('wink_posts');

...

if ($initialMigration) {
   WinkAuthor::create([
       ...
   ]);

   ...
}

So the default login credentials will not created if the wink_posts table already exist in your database. May be the condition for inital user, should determined by number of rows in wink_authors table and also maybe it will be good if there's a command to create new author.

from wink.

themsaid avatar themsaid commented on August 29, 2024

@ladhadha so in your case the tables are created by no initial user is created? The check shouldn't pass if the table doesn't exist.

from wink.

themsaid avatar themsaid commented on August 29, 2024

@javorszky can you share the entries in your migration table?

from wink.

 avatar commented on August 29, 2024

@themsaid yes the tables was created. But theres no initial user create. The steps that I run was.

  • I install fresh laravel app,
  • I add writingink/wink as dependency,
  • I run php artisan migrate <-- I think this step that creating the tables, include wink_*
  • I run php artisan wink:install,
  • I run php artisan wink:migrate, the output was: Nothing to migrate.. Because I already run migration before.

Also I try to remove all, wink_* tables, and then run php artisan wink:migrate, but it gives me output:

Nothing to migrate.

   Illuminate\Database\QueryException  : SQLSTATE[42S02]: Base table or view not found: 1146 Table 'wink.wink_authors' doesn't exist (SQL: insert into `wink_authors` (`id`, `name`, `slug`, `bio`, `email`, `password`, `updated_at`, `created_at`) values (cf3c3e5f-0849-47af-bd1d-16fa946d9d16, Regina Phalange, regina-phalange, This is me., [email protected], $2y$10$N0xME7bPmDPkYP58kFiwweypBwyTnyMLXwKoeXNJ4xPJbOpJk3hCy, 2018-11-08 08:43:59, 2018-11-08 08:43:59))

Migration not running and no table was created. Already inspecting why the migration, it's because the migration file: 2018_10_30_. I try to change the date to current date: Ex: 2018_11_08_, then it works. But I shouldn't rename the migration file name, right?

from wink.

javorszky avatar javorszky commented on August 29, 2024

It only has the laravel ones, but the tables for wink exist.

screen shot 2018-11-08 at 08 48 46

I've done it again, here are steps to reproduce from nothing:

  1. laravel new wink2
  2. cd wink2
  3. composer require writingink/wink
  4. create empty database, and edit .env file so laravel can do its own migrations
  5. php artisan migrate, this migrates laravel tables
  6. php artisan wink:install
  7. add WINK_DB_CONNECTION to .env with the same value as DB_CONNECTION
  8. php artisan wink:migrate
  9. see "No migration needed"

Attached is a complete database dump

laravel.wink2-2018-11-08-08-44-db.sql.gz

from wink.

themsaid avatar themsaid commented on August 29, 2024

Guys you're running the installation steps wrong, don't run php artisan migrate but run php artisan wink:migrate

from wink.

 avatar commented on August 29, 2024

So for the fresh project, php artisan migrate should runned before adding writingink/wink as dependency, right? Or I just need to run php artisan wink:migrate at all?

from wink.

themsaid avatar themsaid commented on August 29, 2024

php artisan wink:migrate migrates wink tables and create an initial user. If you run the migrations before this command will not do anything since the tables already exist.

If you follow the installation steps as is it'll work .. composer require, wink:install, wink:migrate.

from wink.

nateritter avatar nateritter commented on August 29, 2024

I just ran into this same issue and I agree with @javorszky ... docs need to be updated to remove any assumptions that laravel migrate needs to be run. That's not explicit (not implicit enough) in the current documentation to reduce confusion.

Including when to run the traditional laravel setup commands (and/or when not to) to be more explicit in the setup. That would help immensely.

from wink.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.