Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Setup] Run stripe login before setting up webhook #57

Open
thorwebdev opened this issue Oct 3, 2024 · 1 comment
Open

[Setup] Run stripe login before setting up webhook #57

thorwebdev opened this issue Oct 3, 2024 · 1 comment

Comments

@thorwebdev
Copy link

Since folks might use different stripe accounts, might be worthwhile to run stripe login first to make sure folks are logged into their correct account.

@sanjomathew09
Copy link

const postgres = require('postgres');

const sql = postgres(process.env.DATABASE_URL);

async function seed() {
try {
console.log('Seeding database...');

// Enable the `citext` extension
await sql`
  CREATE EXTENSION IF NOT EXISTS citext;
`;

// Ensure the `users` table uses `citext` for the email column
await sql`
  ALTER TABLE users 
  ALTER COLUMN email TYPE citext;
`;

// Insert seed data with `ON CONFLICT` to handle duplicates
await sql`
  INSERT INTO users (email, name, password) 
  VALUES 
    ('[email protected]', 'Test User', 'hashedpassword'),
    ('[email protected]', 'Admin User', 'hashedpassword')
  ON CONFLICT (email) DO NOTHING;
`;

console.log('Seeding completed successfully.');

} catch (error) {
console.error('Error during seed process:', error);
} finally {
sql.end(); // Close the database connection
}
}

seed();

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants