-- Database Migration Plan
CREATE TABLE organizations (
  id uuid PRIMARY KEY,
  name text NOT NULL,
  subscription_plan text DEFAULT 'freemium',
  created_at timestamp with time zone
);

CREATE TABLE products (
  id uuid PRIMARY KEY,
  name text NOT NULL,
  thickness numeric NOT NULL,
  sale_price numeric NOT NULL,
  organization_id uuid REFERENCES organizations(id)
);

CREATE TABLE calculators (
  id uuid PRIMARY KEY,
  name text NOT NULL,
  customer_name text NOT NULL,
  status text DEFAULT 'active'
);

-- Enable Row Level Security
ALTER TABLE products ENABLE ROW LEVEL SECURITY;
CREATE POLICY "users_view_org_products" ON products
  FOR SELECT USING (organization_id IN (
    SELECT organization_id FROM profiles WHERE id = auth.uid()
  ));

-- Create Indexes
CREATE INDEX idx_products_org ON products(organization_id);
CREATE INDEX idx_calculators_org ON calculators(organization_id);

-- Migration Statistics
-- Total Tables: 27
-- Total Indexes: 94
-- RLS Policies: 58
-- Extensions: 6

CREATE EXTENSION IF NOT EXISTS "uuid-ossp";
CREATE EXTENSION IF NOT EXISTS "pgcrypto";

-- Core Functions
CREATE OR REPLACE FUNCTION handle_updated_at()
RETURNS trigger AS $$
BEGIN
  new.updated_at = TIMEZONE('utc', NOW());
  RETURN new;
END;
$$ LANGUAGE plpgsql;

-- Triggers
CREATE TRIGGER update_quotes_updated_at
  BEFORE UPDATE ON quotes
  FOR EACH ROW EXECUTE FUNCTION handle_updated_at();
CREATE TABLE table_0 ( id uuid PRIMARY KEY, data jsonb, created_at timestamp );
ALTER TABLE organizations ADD CONSTRAINT fk_org FOREIGN KEY (id) REFERENCES auth.users(id);
CREATE POLICY "policy_2" ON products FOR SELECT USING (organization_id = auth.uid());
CREATE INDEX idx_3 ON calculators USING btree (organization_id, created_at DESC);
-- Migration Step 4: Enable RLS • Create Policies • Add Constraints • Verify Data Integrity
CREATE TABLE table_5 ( id uuid PRIMARY KEY, data jsonb, created_at timestamp );
ALTER TABLE organizations ADD CONSTRAINT fk_org FOREIGN KEY (id) REFERENCES auth.users(id);
CREATE POLICY "policy_7" ON products FOR SELECT USING (organization_id = auth.uid());
CREATE INDEX idx_8 ON calculators USING btree (organization_id, created_at DESC);
-- Migration Step 9: Enable RLS • Create Policies • Add Constraints • Verify Data Integrity
CREATE TABLE table_10 ( id uuid PRIMARY KEY, data jsonb, created_at timestamp );
ALTER TABLE organizations ADD CONSTRAINT fk_org FOREIGN KEY (id) REFERENCES auth.users(id);
CREATE POLICY "policy_12" ON products FOR SELECT USING (organization_id = auth.uid());
CREATE INDEX idx_13 ON calculators USING btree (organization_id, created_at DESC);
-- Migration Step 14: Enable RLS • Create Policies • Add Constraints • Verify Data Integrity
CREATE TABLE table_15 ( id uuid PRIMARY KEY, data jsonb, created_at timestamp );
ALTER TABLE organizations ADD CONSTRAINT fk_org FOREIGN KEY (id) REFERENCES auth.users(id);
CREATE POLICY "policy_17" ON products FOR SELECT USING (organization_id = auth.uid());
CREATE INDEX idx_18 ON calculators USING btree (organization_id, created_at DESC);
-- Migration Step 19: Enable RLS • Create Policies • Add Constraints • Verify Data Integrity
CREATE TABLE table_20 ( id uuid PRIMARY KEY, data jsonb, created_at timestamp );
ALTER TABLE organizations ADD CONSTRAINT fk_org FOREIGN KEY (id) REFERENCES auth.users(id);
CREATE POLICY "policy_22" ON products FOR SELECT USING (organization_id = auth.uid());
CREATE INDEX idx_23 ON calculators USING btree (organization_id, created_at DESC);
-- Migration Step 24: Enable RLS • Create Policies • Add Constraints • Verify Data Integrity
CREATE TABLE table_25 ( id uuid PRIMARY KEY, data jsonb, created_at timestamp );
ALTER TABLE organizations ADD CONSTRAINT fk_org FOREIGN KEY (id) REFERENCES auth.users(id);
CREATE POLICY "policy_27" ON products FOR SELECT USING (organization_id = auth.uid());
CREATE INDEX idx_28 ON calculators USING btree (organization_id, created_at DESC);
-- Migration Step 29: Enable RLS • Create Policies • Add Constraints • Verify Data Integrity
CREATE TABLE table_30 ( id uuid PRIMARY KEY, data jsonb, created_at timestamp );
ALTER TABLE organizations ADD CONSTRAINT fk_org FOREIGN KEY (id) REFERENCES auth.users(id);
CREATE POLICY "policy_32" ON products FOR SELECT USING (organization_id = auth.uid());
CREATE INDEX idx_33 ON calculators USING btree (organization_id, created_at DESC);
-- Migration Step 34: Enable RLS • Create Policies • Add Constraints • Verify Data Integrity
CREATE TABLE table_35 ( id uuid PRIMARY KEY, data jsonb, created_at timestamp );
ALTER TABLE organizations ADD CONSTRAINT fk_org FOREIGN KEY (id) REFERENCES auth.users(id);
CREATE POLICY "policy_37" ON products FOR SELECT USING (organization_id = auth.uid());
CREATE INDEX idx_38 ON calculators USING btree (organization_id, created_at DESC);
-- Migration Step 39: Enable RLS • Create Policies • Add Constraints • Verify Data Integrity
CREATE TABLE table_40 ( id uuid PRIMARY KEY, data jsonb, created_at timestamp );
ALTER TABLE organizations ADD CONSTRAINT fk_org FOREIGN KEY (id) REFERENCES auth.users(id);
CREATE POLICY "policy_42" ON products FOR SELECT USING (organization_id = auth.uid());
CREATE INDEX idx_43 ON calculators USING btree (organization_id, created_at DESC);
-- Migration Step 44: Enable RLS • Create Policies • Add Constraints • Verify Data Integrity
CREATE TABLE table_45 ( id uuid PRIMARY KEY, data jsonb, created_at timestamp );
ALTER TABLE organizations ADD CONSTRAINT fk_org FOREIGN KEY (id) REFERENCES auth.users(id);
CREATE POLICY "policy_47" ON products FOR SELECT USING (organization_id = auth.uid());
CREATE INDEX idx_48 ON calculators USING btree (organization_id, created_at DESC);
-- Migration Step 49: Enable RLS • Create Policies • Add Constraints • Verify Data Integrity
☑ Extensions enabled
☑ Tables created
☑ RLS policies active
☐ Data migrated
🚀 Ready for production
📊 27 Tables • 94 Indexes
🔒 RLS: ENABLED
✓ Multi-tenant ready

Alt på ett sted for beslag.
Kalkuler.

Norges første ERP for beslagbransjen

Kalkuler, fakturer og administrer – alt i én plattform

★★★★★4.8/5 fra norske bedrifter
Ingen kredittkort nødvendig
Velg Produkt
Velg produkt...
Kommentar
Beskrivelse av prosjekt...
UB.mm
0.0
Lengde (m)
0.0
Antall
0
Rabatt (%)
0
Avanserte alternativer
Bøyninger
0
Arbeidstimer
0
Total med MVA:NOK 0
Base: NOK 976 • Rabatt: -NOK 108 • MVA (25%): NOK 244

Komplett ERP-løsning for beslag

Alt du trenger for å drive din beslagbedrift effektivt, fra kundestyring til ferdig levering

6
6

gode grunner til å
velge oss🚀

Hele kundebasen din. Alltid tilgjengelig.

Alle kunder, kontakter og adresser i ett system. Velg direkte fra kundelisten når du lager kalkyle, sender tilbud eller fakturerer. Ingen e-post-jakt, ingen notater som forsvinner.

Komplett kundeoversikt
Rask søk og filtrering
Kontakthistorikk
Prosjektkoblinger

Kunder

H
Hansen Metall AS
Ole Hansen
ole@hansenmetall.no
+47 900 12 345
Industriveien 25
Oslo, Norge
N
Nordic Steel Solutions
Kari Olsen
kari@nordicsteel.no
+47 911 23 456
Stålgata 12
Bergen, Norge

Den foretrukne løsningen for mer enn 55 norske beslagbedrifter

★★★★★
4.8/5Kjempebra tilbakemeldinger
55+
Aktive norske bedrifter
Bruker VBESLAG daglig
136
Aktive kalkulatorer
For beslagprosjekter
81
Profesjonelle tilbud
Generert med norsk formatering
35
Registrerte brukere
På tvers av organisasjoner

Stolt brukt av ledende norske beslagbedrifter

Hansen Metall AS
Beslagbedrift
Nordic Steel Solutions
Beslagbedrift
Oslo Metallfabrikk
Beslagbedrift
Bergen Stål AS
Beslagbedrift

Klar til å ta kontroll 🚀 over lønnsomheten?

Slutt med manuelle feil og tapte marginer. Over 55 norske beslagbedrifter har allerede startet sin digitale reise med VBESLAG.

Gratis start
Ingen binding
Norsk støtte

Start Gratis i Dag

Ingen kredittkort nødvendig • Klar på 2 minutter

Eller fortsett med

Har du allerede konto? Logg inn

Ubegrenset tilgang i 14 dager
Fullt tilgang til alle funksjoner
Ingen kredittkort påkrevd

Enkle priser for alle størrelser

Start gratis i dag, oppgrader når du trenger mer

Ingen bindingstid
Avslutt når som helst

Freemium

Gratis

Perfekt for små beslagbedrifter som kommer i gang

  • 10 kalkulatorer
  • 100 produkter
  • 5 kunder
  • 2 teammedlemmer
  • Grunnleggende støtte
Start Gratis
Mest Populær

Premium

349 NOK/måned3499 NOK/år

Ubegrenset bruk for voksende bedrifter

  • Ubegrenset kalkulatorer
  • Ubegrenset produkter
  • Ubegrenset kunder
  • Ubegrenset teammedlemmer
  • Prioritert støtte
  • Avanserte funksjoner
Oppgrader Nå

Alle priser er eks. MVA. Fakturering håndteres av Stripe med norsk krone.

Hva dine bransjekollegaer sier om VBESLAG

OH
"VBESLAG har revolusjonert hvordan vi kalkulerer beslagarbeider. Ingen flere manuelle feil og tilbudene ser profesjonelle ut."
Ole Hansen
Eier, Hansen Metall AS
KO
"Den guidede oppstartsopplevelsen fikk oss raskt i gang. Nå bruker hele teamet VBESLAG hver dag."
Kari Olsen
Produksjonssjef, Nordic Steel Solutions

Ofte Stilte Spørsmål

Klar til å Transformere Din Beslagbedrift?

Start din gratis prøveperiode i dag og se hvordan VBESLAG reduserer kalkuleringstid med 80%. Ingen kredittkort nødvendig - 100% uforpliktende.

🚀 Start i dag • Ingen bindingstid • 30 dagers pengene-tilbake-garanti