# Plugin und eigene DB Tabelle?

**URL:** https://forum.shopware.com/t/plugin-und-eigene-db-tabelle/95341
**Category:** Programmierung
**Created:** [18. Juli 2022 um 12:56 UTC](https://forum.shopware.com/t/plugin-und-eigene-db-tabelle/95341 "2022-07-18T12:56:36Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![R4M](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.shopware.com/r4m/32/9983_2.png) [@R4M](https://forum.shopware.com/u/R4M)
#### Post date: [18. Juli 2022 um 12:56 UTC](https://forum.shopware.com/t/plugin-und-eigene-db-tabelle/95341/1 "2022-07-18T12:56:36Z")

</div>

Habe zwar gesucht, bin aber nicht so richtig fündig geworden. Ich suche eine Anleitung wie man in einem SW6 Plugin auch eigene DB Tabellen anlegen kann und natürlich auch unter welchen Vorgaben?

---

<div class="post-metadata">

### Author: ![abdullah](https://avatars.discourse-cdn.com/v4/letter/a/aeb1de/32.png) [@abdullah](https://forum.shopware.com/u/abdullah)
#### Post date: [18. Juli 2022 um 14:03 UTC](https://forum.shopware.com/t/plugin-und-eigene-db-tabelle/95341/2 "2022-07-18T14:03:23Z")

</div>

Laut Shopware Doku kannst du deine Tabellen über die Database Migrations anlegen: [Database migrations - Shopware Developer](https://developer.shopware.com/docs/guides/plugins/plugins/plugin-fundamentals/database-migrations)

An sich kannst du die deine Datenbanktabellen auch in der Plugin Install Methode anlegen. Hier kannst du ebenfalls die DB Connection verwenden, mit der du die executeStatement-Methode aufrufen kannst, um Tabellen anzulegen/zu löschen/zu ändern…

---

<div class="post-metadata">

### Author: ![R4M](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.shopware.com/r4m/32/9983_2.png) [@R4M](https://forum.shopware.com/u/R4M)
#### Post date: [18. Juli 2022 um 14:26 UTC](https://forum.shopware.com/t/plugin-und-eigene-db-tabelle/95341/3 "2022-07-18T14:26:54Z")

</div>

> [@abdullah](#):
>
> Database Migrations

Ja, das muss ich mir noch genauer ansehen. Aktuell habe ich alles beim Plugin Install eingebunden.
