Coder Social home page Coder Social logo

Comments (7)

hwbrzzl avatar hwbrzzl commented on July 18, 2024

Hi, thanks for your issue. Actually, the database/migrations/20221001000000_create_users_table.up.sql file is only applicable to Mysql. If you want to use Postgresql, you need to change the default connection in the config/database.go file and optimize the *.sql file applicable to Postgresql, such as:

CREATE TABLE users(
  id int PRIMARY KEY NOT NULL,
  name VARCHAR
);

If you have any other questions, please contact me, thanks.

from goravel.

sujit-baniya avatar sujit-baniya commented on July 18, 2024

@hwbrzzl I did change the default connection to postgresql. So once the file is generated, I need to change the content of sql for postgresql?

from goravel.

hwbrzzl avatar hwbrzzl commented on July 18, 2024

Yup, the template that creating by go run . artisan make:migration create_users_table is only applicable to Mysql now. We can generate a Postgresql template based on the default connection in the config/database.go file in the future, but unfortunately, we have to change the .sql file manually now.

If you're interested, I'm very glad that you can submit a PR for that. πŸ‘

from goravel.

sujit-baniya avatar sujit-baniya commented on July 18, 2024

I have done something similar for migration here https://github.com/sujit-baniya/db/blob/master/migrations/command_new.go

from goravel.

hwbrzzl avatar hwbrzzl commented on July 18, 2024

Great, stared. πŸ‘

from goravel.

sujit-baniya avatar sujit-baniya commented on July 18, 2024

@hwbrzzl Do you think we could replace current go-migrate/migrate with above?

from goravel.

hwbrzzl avatar hwbrzzl commented on July 18, 2024

If you can perfect your README, I'm glad to read it first.

from goravel.

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.