orm icon indicating copy to clipboard operation
orm copied to clipboard

Add missing migration methods from Laravel

Open maicol07 opened this issue 3 years ago • 6 comments

Describe the feature as you'd like to see it Missing table methods from Laravel docs:

I've added a ❕indicating the ones more important

What do we currently have to do now? Just add these methods

  • [ ] Is this a breaking change?

maicol07 avatar Jul 05 '22 18:07 maicol07

Are you able to open a PR and add these?

josephmancuso avatar Jul 05 '22 19:07 josephmancuso

It would actually be pretty straight forward:

  1. add the method to the blueprint class
  2. add the column map to each Platform class (sqlite, mysql, Postgres and mssql)
  3. Write tests in each other test_{database}_schema_builder.py files

josephmancuso avatar Jul 05 '22 19:07 josephmancuso

Yes, I can look at them

maicol07 avatar Jul 05 '22 19:07 maicol07

Thanks

josephmancuso avatar Jul 05 '22 19:07 josephmancuso

@maicol07 macAddress already exists here's the code in orm

def macaddr(self, column, length=255, nullable=False):
        """Sets a column to be the macaddr representation for the table.

        Arguments:
            column {string} -- The column name.

        Keyword Arguments:
            nullable {bool} -- Whether the column is nullable. (default: {False})

        Returns:
            self
        """
        self._last_column = self.table.add_column(
            column, "macaddr", length=255, nullable=nullable
        )
        return self

yubarajshrestha avatar Oct 25 '22 06:10 yubarajshrestha

@maicol07 macAddress already exists here's the code in orm

def macaddr(self, column, length=255, nullable=False):
        """Sets a column to be the macaddr representation for the table.

        Arguments:
            column {string} -- The column name.

        Keyword Arguments:
            nullable {bool} -- Whether the column is nullable. (default: {False})

        Returns:
            self
        """
        self._last_column = self.table.add_column(
            column, "macaddr", length=255, nullable=nullable
        )
        return self

Thanks! Checked the item in the list!

maicol07 avatar Oct 25 '22 06:10 maicol07