In Magento 2 - How to remove a column in customer_entity table? The Next CEO of Stack OverflowIn the database, what is the relationship between the customer_entity table and sales?How to add new column in quote_item table?Magento2 - Can not save value of custom column in table customer_entitymagento 2 - How to add new column to table customer_grid_flatGet value from custom column from customer_entityHow does magento2 associates an entity with it's table?Join customer_entity snd catalog_product_entity by custom attributeRemove item column from Order PDF printDelete columns from customer_entity magento 2Update field on `customer_entity` table

Is there a difference between "Fahrstuhl" and "Aufzug"?

Does Germany produce more waste than the US?

how one can write a nice vector parser, something that does pgfvecparseA=B-C; D=E x F;

Audio Conversion With ADS1243

Are the names of these months realistic?

Is it correct to say moon starry nights?

Where do students learn to solve polynomial equations these days?

What would be the main consequences for a country leaving the WTO?

Traveling with my 5 year old daughter (as the father) without the mother from Germany to Mexico

Can Sneak Attack be used when hitting with an improvised weapon?

Point distance program written without a framework

Man transported from Alternate World into ours by a Neutrino Detector

How did Beeri the Hittite come up with naming his daughter Yehudit?

Airplane gently rocking its wings during whole flight

Help/tips for a first time writer?

what's the use of '% to gdp' type of variables?

Why is the US ranked as #45 in Press Freedom ratings, despite its extremely permissive free speech laws?

Yu-Gi-Oh cards in Python 3

Reference request: Grassmannian and Plucker coordinates in type B, C, D

What CSS properties can the br tag have?

Is there an equivalent of cd - for cp or mv

"Eavesdropping" vs "Listen in on"

free fall ellipse or parabola?

Do scriptures give a method to recognize a truly self-realized person/jivanmukta?



In Magento 2 - How to remove a column in customer_entity table?



The Next CEO of Stack OverflowIn the database, what is the relationship between the customer_entity table and sales?How to add new column in quote_item table?Magento2 - Can not save value of custom column in table customer_entitymagento 2 - How to add new column to table customer_grid_flatGet value from custom column from customer_entityHow does magento2 associates an entity with it's table?Join customer_entity snd catalog_product_entity by custom attributeRemove item column from Order PDF printDelete columns from customer_entity magento 2Update field on `customer_entity` table










7















In Magento 2, How to remove a column in customer_entity table?










share|improve this question




























    7















    In Magento 2, How to remove a column in customer_entity table?










    share|improve this question


























      7












      7








      7


      1






      In Magento 2, How to remove a column in customer_entity table?










      share|improve this question
















      In Magento 2, How to remove a column in customer_entity table?







      magento2 customer






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Mar 19 at 7:45









      magefms

      2,1352426




      2,1352426










      asked Dec 30 '16 at 8:14









      MrTo-KaneMrTo-Kane

      1,78162465




      1,78162465




















          3 Answers
          3






          active

          oldest

          votes


















          13














          In your setup script, we can use dropColumn:



           $setup->getConnection()->dropColumn($setup->getTable('your_table'), 'your_column');





          share|improve this answer























          • doing with UpgradeSchema.php is a better and cleaner solution

            – Blueblazer172
            Oct 9 '17 at 12:39


















          5














          You can try this simple dropColumn() function in your installer script.



          $this->startSetup();

          //example:
          $this->getConnection()->dropColumn($this->getTable('your_table_definition'), 'your column name', $schemaName = null)

          $this->endSetup();





          share|improve this answer

























          • thank your answer!

            – MrTo-Kane
            Dec 30 '16 at 8:40


















          5














          Here is my solution, maybe good for referring for other.

          I created TohqCustomerSetupUpgradeSchema.php file:



          <?php

          namespace TohqCustomerSetup;

          use MagentoFrameworkSetupUpgradeSchemaInterface;
          use MagentoFrameworkSetupModuleContextInterface;
          use MagentoFrameworkSetupSchemaSetupInterface;

          /**
          * @codeCoverageIgnore
          */
          class UpgradeSchema implements UpgradeSchemaInterface

          public function upgrade(SchemaSetupInterface $setup, ModuleContextInterface $context)

          // Version of module in setup table is less then the give value.
          if (version_compare($context->getVersion(), '0.1.4', '<'))

          // get table customer_entity
          $eavTable = $setup->getTable('customer_entity');

          // Check if the table already exists
          if ($setup->getConnection()->isTableExists($eavTable) == true)
          $connection = $setup->getConnection();

          // del_flg = column name which you want to delete
          $connection->dropColumn($eavTable, 'del_flg');










          share|improve this answer

























            Your Answer








            StackExchange.ready(function()
            var channelOptions =
            tags: "".split(" "),
            id: "479"
            ;
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function()
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled)
            StackExchange.using("snippets", function()
            createEditor();
            );

            else
            createEditor();

            );

            function createEditor()
            StackExchange.prepareEditor(
            heartbeatType: 'answer',
            autoActivateHeartbeat: false,
            convertImagesToLinks: false,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: null,
            bindNavPrevention: true,
            postfix: "",
            imageUploader:
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            ,
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            );



            );













            draft saved

            draft discarded


















            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f152484%2fin-magento-2-how-to-remove-a-column-in-customer-entity-table%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown

























            3 Answers
            3






            active

            oldest

            votes








            3 Answers
            3






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            13














            In your setup script, we can use dropColumn:



             $setup->getConnection()->dropColumn($setup->getTable('your_table'), 'your_column');





            share|improve this answer























            • doing with UpgradeSchema.php is a better and cleaner solution

              – Blueblazer172
              Oct 9 '17 at 12:39















            13














            In your setup script, we can use dropColumn:



             $setup->getConnection()->dropColumn($setup->getTable('your_table'), 'your_column');





            share|improve this answer























            • doing with UpgradeSchema.php is a better and cleaner solution

              – Blueblazer172
              Oct 9 '17 at 12:39













            13












            13








            13







            In your setup script, we can use dropColumn:



             $setup->getConnection()->dropColumn($setup->getTable('your_table'), 'your_column');





            share|improve this answer













            In your setup script, we can use dropColumn:



             $setup->getConnection()->dropColumn($setup->getTable('your_table'), 'your_column');






            share|improve this answer












            share|improve this answer



            share|improve this answer










            answered Dec 30 '16 at 8:21









            Khoa TruongDinhKhoa TruongDinh

            22k64187




            22k64187












            • doing with UpgradeSchema.php is a better and cleaner solution

              – Blueblazer172
              Oct 9 '17 at 12:39

















            • doing with UpgradeSchema.php is a better and cleaner solution

              – Blueblazer172
              Oct 9 '17 at 12:39
















            doing with UpgradeSchema.php is a better and cleaner solution

            – Blueblazer172
            Oct 9 '17 at 12:39





            doing with UpgradeSchema.php is a better and cleaner solution

            – Blueblazer172
            Oct 9 '17 at 12:39













            5














            You can try this simple dropColumn() function in your installer script.



            $this->startSetup();

            //example:
            $this->getConnection()->dropColumn($this->getTable('your_table_definition'), 'your column name', $schemaName = null)

            $this->endSetup();





            share|improve this answer

























            • thank your answer!

              – MrTo-Kane
              Dec 30 '16 at 8:40















            5














            You can try this simple dropColumn() function in your installer script.



            $this->startSetup();

            //example:
            $this->getConnection()->dropColumn($this->getTable('your_table_definition'), 'your column name', $schemaName = null)

            $this->endSetup();





            share|improve this answer

























            • thank your answer!

              – MrTo-Kane
              Dec 30 '16 at 8:40













            5












            5








            5







            You can try this simple dropColumn() function in your installer script.



            $this->startSetup();

            //example:
            $this->getConnection()->dropColumn($this->getTable('your_table_definition'), 'your column name', $schemaName = null)

            $this->endSetup();





            share|improve this answer















            You can try this simple dropColumn() function in your installer script.



            $this->startSetup();

            //example:
            $this->getConnection()->dropColumn($this->getTable('your_table_definition'), 'your column name', $schemaName = null)

            $this->endSetup();






            share|improve this answer














            share|improve this answer



            share|improve this answer








            edited Dec 30 '16 at 8:35

























            answered Dec 30 '16 at 8:22









            chiragchirag

            2,1421830




            2,1421830












            • thank your answer!

              – MrTo-Kane
              Dec 30 '16 at 8:40

















            • thank your answer!

              – MrTo-Kane
              Dec 30 '16 at 8:40
















            thank your answer!

            – MrTo-Kane
            Dec 30 '16 at 8:40





            thank your answer!

            – MrTo-Kane
            Dec 30 '16 at 8:40











            5














            Here is my solution, maybe good for referring for other.

            I created TohqCustomerSetupUpgradeSchema.php file:



            <?php

            namespace TohqCustomerSetup;

            use MagentoFrameworkSetupUpgradeSchemaInterface;
            use MagentoFrameworkSetupModuleContextInterface;
            use MagentoFrameworkSetupSchemaSetupInterface;

            /**
            * @codeCoverageIgnore
            */
            class UpgradeSchema implements UpgradeSchemaInterface

            public function upgrade(SchemaSetupInterface $setup, ModuleContextInterface $context)

            // Version of module in setup table is less then the give value.
            if (version_compare($context->getVersion(), '0.1.4', '<'))

            // get table customer_entity
            $eavTable = $setup->getTable('customer_entity');

            // Check if the table already exists
            if ($setup->getConnection()->isTableExists($eavTable) == true)
            $connection = $setup->getConnection();

            // del_flg = column name which you want to delete
            $connection->dropColumn($eavTable, 'del_flg');










            share|improve this answer





























              5














              Here is my solution, maybe good for referring for other.

              I created TohqCustomerSetupUpgradeSchema.php file:



              <?php

              namespace TohqCustomerSetup;

              use MagentoFrameworkSetupUpgradeSchemaInterface;
              use MagentoFrameworkSetupModuleContextInterface;
              use MagentoFrameworkSetupSchemaSetupInterface;

              /**
              * @codeCoverageIgnore
              */
              class UpgradeSchema implements UpgradeSchemaInterface

              public function upgrade(SchemaSetupInterface $setup, ModuleContextInterface $context)

              // Version of module in setup table is less then the give value.
              if (version_compare($context->getVersion(), '0.1.4', '<'))

              // get table customer_entity
              $eavTable = $setup->getTable('customer_entity');

              // Check if the table already exists
              if ($setup->getConnection()->isTableExists($eavTable) == true)
              $connection = $setup->getConnection();

              // del_flg = column name which you want to delete
              $connection->dropColumn($eavTable, 'del_flg');










              share|improve this answer



























                5












                5








                5







                Here is my solution, maybe good for referring for other.

                I created TohqCustomerSetupUpgradeSchema.php file:



                <?php

                namespace TohqCustomerSetup;

                use MagentoFrameworkSetupUpgradeSchemaInterface;
                use MagentoFrameworkSetupModuleContextInterface;
                use MagentoFrameworkSetupSchemaSetupInterface;

                /**
                * @codeCoverageIgnore
                */
                class UpgradeSchema implements UpgradeSchemaInterface

                public function upgrade(SchemaSetupInterface $setup, ModuleContextInterface $context)

                // Version of module in setup table is less then the give value.
                if (version_compare($context->getVersion(), '0.1.4', '<'))

                // get table customer_entity
                $eavTable = $setup->getTable('customer_entity');

                // Check if the table already exists
                if ($setup->getConnection()->isTableExists($eavTable) == true)
                $connection = $setup->getConnection();

                // del_flg = column name which you want to delete
                $connection->dropColumn($eavTable, 'del_flg');










                share|improve this answer















                Here is my solution, maybe good for referring for other.

                I created TohqCustomerSetupUpgradeSchema.php file:



                <?php

                namespace TohqCustomerSetup;

                use MagentoFrameworkSetupUpgradeSchemaInterface;
                use MagentoFrameworkSetupModuleContextInterface;
                use MagentoFrameworkSetupSchemaSetupInterface;

                /**
                * @codeCoverageIgnore
                */
                class UpgradeSchema implements UpgradeSchemaInterface

                public function upgrade(SchemaSetupInterface $setup, ModuleContextInterface $context)

                // Version of module in setup table is less then the give value.
                if (version_compare($context->getVersion(), '0.1.4', '<'))

                // get table customer_entity
                $eavTable = $setup->getTable('customer_entity');

                // Check if the table already exists
                if ($setup->getConnection()->isTableExists($eavTable) == true)
                $connection = $setup->getConnection();

                // del_flg = column name which you want to delete
                $connection->dropColumn($eavTable, 'del_flg');











                share|improve this answer














                share|improve this answer



                share|improve this answer








                edited Mar 30 '18 at 12:18









                Kanhaiya lal

                880417




                880417










                answered Dec 30 '16 at 8:46









                MrTo-KaneMrTo-Kane

                1,78162465




                1,78162465



























                    draft saved

                    draft discarded
















































                    Thanks for contributing an answer to Magento Stack Exchange!


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid


                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.

                    To learn more, see our tips on writing great answers.




                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function ()
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f152484%2fin-magento-2-how-to-remove-a-column-in-customer-entity-table%23new-answer', 'question_page');

                    );

                    Post as a guest















                    Required, but never shown





















































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown

































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown







                    Popular posts from this blog

                    Masuk log Menu navigasi

                    16 Maret Daftar isi Peristiwa | Kelahiran | Meninggal | Hari raya dan peringatan | Menu navigasis

                    ジョン・ファウルズ