profile
viewpoint
If you are wondering where the data of this site comes from, please visit https://api.github.com/users/holic-cl/events. GitMemory does not store any data, but only uses NGINX to cache data for a period of time. The idea behind GitMemory is simply to give users a better reading experience.
Fernando holic-cl Algarrobo, Chile From Tauri planet. Web developer, code learner, love photography and nature

holic-cl/Panel 2

Pterodactyl Panel is the free, open-source, game agnostic, self-hosted control panel for users, networks, and game service providers. Pterodactyl supports games and servers such as Minecraft (including Spigot, Bungeecord, and Sponge), ARK: Evolution Evolved, CS:GO, Team Fortress 2, Insurgency, Teamspeak 3, Mumble, and many more. Control all of your games from one unified interface.

ggpfeifer/GeoconflictClient 1

Cliente de Geoconflict

holic-cl/Timberman-JS 1

TimberMan make with EasySprite.js

labs-holic/laravel-pusher-demo 1

Laravel 5.3 web push (with pusher services) demo.

labs-holic/the-specification-pattern 1

The secification pattern on php (example from laracast.com).

holic-cl/aliases 0

repo to keep my aliases file

holic-cl/checklistable 0

Make any model checklistable with answer associated by model_id

holic-cl/churn-php 0

Discover files in need of refactoring.

holic-cl/clumsy-bird 0

:bird: :video_game: A MelonJS port of the famous Flappy Bird Game

holic-cl/collapse 0

Collapse component for Vue Bulma

startedmicheleg/dash-to-dock

started time in 3 days

startedIsmaelMartinez/teams-for-linux

started time in 15 days

issue commentMasoniteFramework/orm

Error migrations on Mysql: Foreign key constraint is incorrectly formed

Thanks!, now migrations are working

holic-cl

comment created time in a month

startedapache/jmeter

started time in a month

issue openedMasoniteFramework/orm

Error migrations on Mysql: Foreign key constraint is incorrectly formed

Describe the bug Error running migrations on MySQL, but it is working well on PostgreSQL

  QueryException

  (1005, 'Can\'t create table `dev`.`purchase_orders` (errno: 150 "Foreign key constraint is incorrectly formed")')

To Reproduce Steps to reproduce the behavior:

  1. Create these migrations
  2. Migrate it on Postgresql
  3. Migrate it on Mysql
  4. See error

Expected behavior If a migration is working well on PostgreSQL i expect to have succes on MySQL too

Screenshots or code snippets My migrations envolved

class CreateCostCentersTable(Migration):
    def up(self):
        """
        Run the migrations.
        """
        with self.schema.create("cost_centers") as table:
            table.increments("id")
            table.string("code").unique()
            table.string("name")
            table.timestamps()

    def down(self):
        """
        Revert the migrations.
        """
        self.schema.drop("cost_centers")

class CreateWarehousesTable(Migration):
    def up(self):
        """
        Run the migrations.
        """
        with self.schema.create("warehouses") as table:
            table.increments("id")
            table.string("code").unique()
            table.string("name")
            table.timestamps()

    def down(self):
        """
        Revert the migrations.
        """
        self.schema.drop("warehouses")

class CreatePurchaseOrdersTable(Migration):
    def up(self):
        """
        Run the migrations.
        """
        with self.schema.create("purchase_orders") as table:
            table.increments("id")
            table.date("date")_code")
            table.integer("warehouse_id")
            table.foreign("warehouse_id").references("id").on("warehouses")
            table.integer("cost_center_id")
            table.foreign("cost_center_id").references("id").on("cost_centers")
            table.timestamps()

    def down(self):
        """
        Revert the migrations.
        """
        self.schema.drop("purchase_orders")

Desktop (please complete the following information): Distributor ID: Ubuntu Description: Ubuntu 20.04.2 LTS Release: 20.04 Codename: focal

masonite==3.0.12 masonite-dot==0.0.5 masonite-logging==1.0.1 masonite-orm==1.0.54 masonite-validation==3.0.14

What database are you using?

  • mariadb-server 1:10.3.30-0ubuntu0.20.04.1
  • postgresql-12 12.7-0ubuntu0.20.04.1

created time in a month

issue commentMasoniteFramework/orm

drop_index not work on postgresql

I have same issue:

My Migration:

class AddIndexesToRelationships(Migration):
    def up(self):
        """
        Run the migrations.
        """
        with self.schema.table('branches') as table:
            table.index('code')

    def down(self):
        """
        Revert the migrations.
        """
        with self.schema.table('branches') as table:
            table.drop_index(['code'])

My database after run the migration:

opticks=# \d branches
                                        Table "public.branches"
   Column   |            Type             | Collation | Nullable |               Default                
------------+-----------------------------+-----------+----------+--------------------------------------
 id         | integer                     |           | not null | nextval('branches_id_seq'::regclass)
 code       | character varying(255)      |           | not null | 
 name       | character varying(255)      |           | not null | 
 created_at | timestamp without time zone |           |          | CURRENT_TIMESTAMP
 updated_at | timestamp without time zone |           |          | CURRENT_TIMESTAMP
Indexes:
    "branches_id_primary" PRIMARY KEY, btree (id)
    "branches_code_unique" UNIQUE CONSTRAINT, btree (code)
    "branches_code_index" btree (code)
Referenced by:
    TABLE "warehouses" CONSTRAINT "warehouses_branch_id_foreign" FOREIGN KEY (branch_id) REFERENCES branches(id)

The error i got:

  QueryException

  constraint "branches_code_index" of relation "branches" does not exist
OnePieceLv

comment created time in a month

startedmattia-battiston/clean-architecture-example

started time in 2 months

startedCreatedd/web-miner

started time in 2 months

startedalecthomas/injector

started time in 2 months

startedpython/mypy

started time in 2 months

startedsamuelcolvin/python-devtools

started time in 2 months

startedsamuelcolvin/pydantic

started time in 2 months

startedgleitz/howdoi

started time in 2 months

startedrealpython/python-guide

started time in 2 months

startedapdaza/patrones-gof-python

started time in 2 months

startedmvantellingen/python-zeep

started time in 2 months

startedjabas06/l2tp-ipsec-vpn-client

started time in 2 months

startedgoogle/gson

started time in 2 months

startedFasterXML/jackson

started time in 2 months

startedgirardinsamuel/masonite-inertia

started time in 2 months

startedinertiajs/inertia

started time in 2 months

startedeh3rrera/shopping-cart-pusher

started time in 3 months