# can we add a new column to the table s\_orders

**URL:** <https://forum.shopware.com/t/can-we-add-a-new-column-to-the-table-s-orders/43849>\
**Category:** Programmierung\
**Created:** [19. Februar 2017 um 13:45 UTC](https://forum.shopware.com/t/can-we-add-a-new-column-to-the-table-s-orders/43849 "2017-02-19T13:45:39Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![jijo](https://avatars.discourse-cdn.com/v4/letter/j/eb8c5e/32.png) [@jijo](https://forum.shopware.com/u/jijo)\
**Post date:** [19. Februar 2017 um 13:45 UTC](https://forum.shopware.com/t/can-we-add-a-new-column-to-the-table-s-orders/43849/1 "2017-02-19T13:45:39Z")

</div>

Hi

Can we add a new column to the order DB table s\_orders. If so how what &nbsp;all steps has to be done in the&nbsp;/Models/Order/Order.php and any other files if necessary

&nbsp;

Thx for any help

---

<div class="post-metadata">

**Author:** ![simkli](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.shopware.com/simkli/32/13124_2.png) [@simkli](https://forum.shopware.com/u/simkli)\
**Post date:** [19. Februar 2017 um 14:32 UTC](https://forum.shopware.com/t/can-we-add-a-new-column-to-the-table-s-orders/43849/2 "2017-02-19T14:32:53Z")

</div>

Hi jijo,

no you’re not supposed to create new columns in any table except the \*\_attributes tables. Never ever touch any Shopware core files. You should use&nbsp;the plugin-system for any modification.  
There’s a tutorial about Shopware’s attribute system in the developer documentation.&nbsp;[Attribute system](https://developers.shopware.com/developers-guide/attribute-system "Attribute system").  
The table you’re looking for would be the s\_orders\_attributes.

---

<div class="post-metadata">

**Author:** ![brettvormkopp](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.shopware.com/brettvormkopp/32/7788_2.png) [@brettvormkopp](https://forum.shopware.com/u/brettvormkopp)\
**Post date:** [19. Februar 2017 um 14:56 UTC](https://forum.shopware.com/t/can-we-add-a-new-column-to-the-table-s-orders/43849/3 "2017-02-19T14:56:20Z")

</div>

A common practice i’ve seen, while using this in&nbsp;plugins, is to create a new table called s\_plugin\_PLUGINNAME. There you reference to a orderID or whatever

---

<div class="post-metadata">

**Author:** ![simkli](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.shopware.com/simkli/32/13124_2.png) [@simkli](https://forum.shopware.com/u/simkli)\
**Post date:** [19. Februar 2017 um 15:04 UTC](https://forum.shopware.com/t/can-we-add-a-new-column-to-the-table-s-orders/43849/4 "2017-02-19T15:04:44Z")

</div>

> [@brettvormkopp schrieb:](https://forum.shopware.com/profile/6611/brettvormkopp "brettvormkopp")
> 
> A common practice i’ve seen, while using this in&nbsp;plugins, is to create a new table called s\_plugin\_PLUGINNAME. There you reference to a orderID or whatever

I think this only makes&nbsp;sense for 1:n relations and should be considered as bad practice for 1:1 relations. For 1:1 relations you should refer&nbsp;to the attribute&nbsp;tables. The attribute system also retrives the data for you so you don’t have to make a separate database request.
